Bug 199006 there are two independent initializations of nsMemoryImpl before Init_XPCOM2 finishes

r=dougt
This commit is contained in:
timeless%mozdev.org 2003-04-07 14:20:19 +00:00
Родитель 23f3006361
Коммит 37891802cb
1 изменённых файлов: 4 добавлений и 2 удалений

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

@ -212,6 +212,8 @@ MemoryFlusher::Stop()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
nsMemoryImpl* gMemory = nsnull;
NS_IMPL_THREADSAFE_ISUPPORTS1(nsMemoryImpl, nsIMemory) NS_IMPL_THREADSAFE_ISUPPORTS1(nsMemoryImpl, nsIMemory)
NS_METHOD NS_METHOD
@ -219,6 +221,8 @@ nsMemoryImpl::Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr)
{ {
NS_ENSURE_ARG_POINTER(aInstancePtr); NS_ENSURE_ARG_POINTER(aInstancePtr);
NS_ENSURE_PROPER_AGGREGATION(outer, aIID); NS_ENSURE_PROPER_AGGREGATION(outer, aIID);
if (gMemory && NS_SUCCEEDED(gMemory->QueryInterface(aIID, aInstancePtr)))
return NS_OK;
nsMemoryImpl* mm = new nsMemoryImpl(); nsMemoryImpl* mm = new nsMemoryImpl();
if (mm == NULL) if (mm == NULL)
@ -484,8 +488,6 @@ nsMemoryImpl::DestroyFlushEvent(PLEvent* aEvent)
// no-op, since mEvent is a member of nsMemoryImpl // no-op, since mEvent is a member of nsMemoryImpl
} }
nsMemoryImpl* gMemory = nsnull;
static void static void
EnsureGlobalMemoryService() EnsureGlobalMemoryService()
{ {