Bug 101294 - make sure that nsPref is never unhappy at construction time, r=caillon, sr=dveditz

This commit is contained in:
timeless@mozdev.org 2009-01-15 20:02:22 -08:00
parent 649763f2c3
commit b46bf85337

View File

@ -709,10 +709,13 @@ NS_IMETHODIMP nsPref::SecurityClearUserPref(const char *pref_name)
nsPref* nsPref::GetInstance()
//----------------------------------------------------------------------------------------
{
if (gInstance)
return gInstance;
NS_NEWXPCOM(gInstance, nsPref);
if (!gInstance)
{
NS_NEWXPCOM(gInstance, nsPref);
}
return nsnull;
if (!gInstance->mPrefService)
NS_RELEASE(gInstance);
return gInstance;
} // nsPref::GetInstance