Change how we detect if xpcom was initialized. Not part of the build.

This commit is contained in:
mhammond%skippinet.com.au 2006-06-05 07:22:27 +00:00
Родитель 928b5dc750
Коммит 1ed8e1a215
1 изменённых файлов: 5 добавлений и 6 удалений

Просмотреть файл

@ -51,8 +51,8 @@
#include "nsIFile.h" #include "nsIFile.h"
#include "nsIComponentRegistrar.h" #include "nsIComponentRegistrar.h"
#include "nsIConsoleService.h" #include "nsIConsoleService.h"
#include "nsDirectoryServiceDefs.h"
//#include "nsThreadManager.h"
#include "nsILocalFile.h" #include "nsILocalFile.h"
#include "nsTraceRefcntImpl.h" #include "nsTraceRefcntImpl.h"
@ -475,12 +475,12 @@ static PRBool EnsureXPCOM()
{ {
static PRBool bHaveInitXPCOM = PR_FALSE; static PRBool bHaveInitXPCOM = PR_FALSE;
if (!bHaveInitXPCOM) { if (!bHaveInitXPCOM) {
/***
// xpcom appears to assert if already initialized // xpcom appears to assert if already initialized
// Is there an official way to determine this? // Is there an official way to determine this?
nsThreadManager *mgr = nsThreadManager::get(); // Been through lots of iterations - but getting the
nsCOMPtr<nsIThread> thread_check; // app directories appears to work.
if (!mgr || NS_FAILED(mgr->GetMainThread(getter_AddRefs(thread_check)))) { nsCOMPtr<nsIFile> file;
if (NS_FAILED(NS_GetSpecialDirectory(NS_GRE_DIR, getter_AddRefs(file)))) {
// not already initialized. // not already initialized.
#ifdef XP_WIN #ifdef XP_WIN
// On Windows, we need to locate the Mozilla bin // On Windows, we need to locate the Mozilla bin
@ -523,7 +523,6 @@ static PRBool EnsureXPCOM()
return PR_FALSE; return PR_FALSE;
} }
} }
***/
// Even if xpcom was already init, we want to flag it as init! // Even if xpcom was already init, we want to flag it as init!
bHaveInitXPCOM = PR_TRUE; bHaveInitXPCOM = PR_TRUE;
} }