From 5f6737814a012eed288a4c60b87fa019dfc4cb3e Mon Sep 17 00:00:00 2001 From: "mhammond%skippinet.com.au" Date: Wed, 16 Apr 2003 01:26:51 +0000 Subject: [PATCH] Initialize a static to be nice, and printf() errors if the console service is not available. Not part of the build. --- extensions/python/xpcom/src/ErrorUtils.cpp | 2 ++ extensions/python/xpcom/src/dllmain.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/python/xpcom/src/ErrorUtils.cpp b/extensions/python/xpcom/src/ErrorUtils.cpp index 32eba31a35c..844e5bda230 100644 --- a/extensions/python/xpcom/src/ErrorUtils.cpp +++ b/extensions/python/xpcom/src/ErrorUtils.cpp @@ -42,6 +42,8 @@ void LogMessage(const char *prefix, const char *pszMessageText) NS_ABORT_IF_FALSE(consoleService, "Where is the console service?"); if (consoleService) consoleService->LogStringMessage(NS_ConvertASCIItoUCS2(pszMessageText).get()); + else + printf("%s\n", pszMessageText); } void LogMessage(const char *prefix, nsACString &text) diff --git a/extensions/python/xpcom/src/dllmain.cpp b/extensions/python/xpcom/src/dllmain.cpp index c02e77dcdb5..2707e82d6a8 100644 --- a/extensions/python/xpcom/src/dllmain.cpp +++ b/extensions/python/xpcom/src/dllmain.cpp @@ -39,7 +39,7 @@ static PRInt32 g_cLockCount = 0; static PyThreadState *ptsGlobal = nsnull; -PyInterpreterState *PyXPCOM_InterpreterState; +PyInterpreterState *PyXPCOM_InterpreterState = nsnull; static PRLock *g_lockMain = nsnull; PRUintn tlsIndex = 0;