From b052c8e4dfec325062160bd30bda5fec737ea309 Mon Sep 17 00:00:00 2001 From: "shaver%netscape.com" Date: Wed, 8 Sep 1999 04:22:37 +0000 Subject: [PATCH] fix MLK bugs 13285 and 13286 and prevent repeated PrePopulateRegistry calls git-svn-id: svn://10.0.0.236/trunk@46297 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/components/nsComponentManager.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mozilla/xpcom/components/nsComponentManager.cpp b/mozilla/xpcom/components/nsComponentManager.cpp index cd91b5a0561..fc67b1ac559 100644 --- a/mozilla/xpcom/components/nsComponentManager.cpp +++ b/mozilla/xpcom/components/nsComponentManager.cpp @@ -741,6 +741,8 @@ nsresult nsComponentManagerImpl::PlatformPrePopulateRegistry() { nsresult rv; + if (mPrePopulationDone) + return NS_OK; // Read in all CID entries and populate the mFactories nsCOMPtr cidEnum; rv = mRegistry->EnumerateSubtrees( mCLSIDKey, getter_AddRefs(cidEnum)); @@ -773,7 +775,6 @@ nsresult nsComponentManagerImpl::PlatformPrePopulateRegistry() char *library = NULL; rv = mRegistry->GetString(cidKey, inprocServerValueName, &library); if (NS_FAILED(rv)) continue; - autoStringFree delete_library(library, autoStringFree::NSPR_Delete); nsCID aClass; if (!(aClass.Parse(cidString))) continue; @@ -783,9 +784,8 @@ nsresult nsComponentManagerImpl::PlatformPrePopulateRegistry() continue; nsFactoryEntry* entry = - new nsFactoryEntry(aClass, PL_strdup(library), - /* hand off */ - componentType, + /* hand off componentType and library to factory */ + new nsFactoryEntry(aClass, library, componentType, nsCRT::strcmp(componentType, nativeComponentType) ? 0 : mNativeComponentLoader); @@ -1556,6 +1556,7 @@ nsComponentManagerImpl::RegisterComponentCommon(const nsCID &aClass, goto out; } + /* hand off aRegistryName to entry */ newEntry = new nsFactoryEntry(aClass, aRegistryName, nsCRT::strdup(aType), loader);