Bug 97828. Be sure to create the static component loader before putting it into mLoaderData array. r=dp, sr=jband/sfraser, a=asa
This commit is contained in:
Родитель
dbd90ba1be
Коммит
becc569cc0
|
@ -327,18 +327,17 @@ nsresult nsComponentManagerImpl::Init(void)
|
|||
mNLoaderData++;
|
||||
|
||||
#ifdef ENABLE_STATIC_COMPONENT_LOADER
|
||||
mLoaderData[mNLoaderData].type = PL_strdup(staticComponentType);
|
||||
mLoaderData[mNLoaderData].loader = mStaticComponentLoader;
|
||||
NS_ADDREF(mLoaderData[mNLoaderData].loader);
|
||||
mNLoaderData++;
|
||||
|
||||
if (mStaticComponentLoader == nsnull) {
|
||||
extern nsresult NS_NewStaticComponentLoader(nsIComponentLoader **);
|
||||
NS_NewStaticComponentLoader(&mStaticComponentLoader);
|
||||
if (!mStaticComponentLoader)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(mStaticComponentLoader);
|
||||
}
|
||||
|
||||
mLoaderData[mNLoaderData].type = PL_strdup(staticComponentType);
|
||||
mLoaderData[mNLoaderData].loader = mStaticComponentLoader;
|
||||
NS_ADDREF(mLoaderData[mNLoaderData].loader);
|
||||
mNLoaderData++;
|
||||
#endif
|
||||
|
||||
#ifdef USE_REGISTRY
|
||||
|
|
|
@ -210,7 +210,7 @@ nsStaticComponentLoader::GetFactory(const nsCID &aCID, const char *aLocation,
|
|||
nsresult
|
||||
NS_NewStaticComponentLoader(nsIComponentLoader **retval)
|
||||
{
|
||||
*retval = NS_STATIC_CAST(nsIComponentLoader *,
|
||||
new nsStaticComponentLoader);
|
||||
NS_IF_ADDREF(*retval = NS_STATIC_CAST(nsIComponentLoader *,
|
||||
new nsStaticComponentLoader));
|
||||
return *retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче