зеркало из https://github.com/mozilla/gecko-dev.git
Bug 241697 - bulletproof prefservice globals for xpcom-restart r+sr=darin
This commit is contained in:
Родитель
5b69da3b7c
Коммит
c688ac86cb
|
@ -82,9 +82,6 @@ static PRBool isSharingEnabled();
|
|||
static nsresult openPrefFile(nsIFile* aFile);
|
||||
static nsresult pref_InitInitialObjects(void);
|
||||
|
||||
// needed so we can still get the JS Runtime Service during XPCOM shutdown
|
||||
static nsIJSRuntimeService* gJSRuntimeService = nsnull; // owning reference
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
|
@ -105,7 +102,6 @@ nsPrefService::~nsPrefService()
|
|||
{
|
||||
PREF_Cleanup();
|
||||
NS_IF_RELEASE(mCurrentFile);
|
||||
NS_IF_RELEASE(gJSRuntimeService);
|
||||
|
||||
#ifdef MOZ_PROFILESHARING
|
||||
NS_IF_RELEASE(mCurrentSharedFile);
|
||||
|
|
|
@ -36,6 +36,9 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef nsPrefService_h__
|
||||
#define nsPrefService_h__
|
||||
|
||||
#include "nsIPrefService.h"
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "nsIPrefBranchInternal.h"
|
||||
|
@ -82,3 +85,4 @@ private:
|
|||
nsIFile* mCurrentSharedFile;
|
||||
};
|
||||
|
||||
#endif // nsPrefService_h__
|
||||
|
|
|
@ -40,6 +40,11 @@
|
|||
#include "nsPrefService.h"
|
||||
#include "nsPrefBranch.h"
|
||||
#include "nsIPref.h"
|
||||
#include "prefapi.h"
|
||||
|
||||
#ifdef MOZ_PROFILESHARING
|
||||
#include "nsSharedPrefHandler.h"
|
||||
#endif
|
||||
|
||||
// remove this when nsPref goes away
|
||||
extern NS_IMETHODIMP nsPrefConstructor(nsISupports *aOuter, REFNSIID aIID, void **aResult);
|
||||
|
@ -81,5 +86,15 @@ static const nsModuleComponentInfo components[] =
|
|||
},
|
||||
};
|
||||
|
||||
NS_IMPL_NSGETMODULE(nsPrefModule, components)
|
||||
static void
|
||||
UnloadPrefsModule(nsIModule* unused)
|
||||
{
|
||||
PREF_Cleanup();
|
||||
|
||||
#ifdef MOZ_PROFILESHARING
|
||||
NS_ASSERTION(!gSharedPrefHandler, "Leaking the shared pref handler (and the prefservice, presumably).");
|
||||
gSharedPrefHandler = nsnull;
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMPL_NSGETMODULE_WITH_DTOR(nsPrefModule, components, UnloadPrefsModule)
|
||||
|
|
Загрузка…
Ссылка в новой задаче