mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Bug 1184397 - Release the observer service when the permission manager shuts down; r=jdm
This commit is contained in:
parent
bbb4832c4e
commit
025cee7b63
@ -436,6 +436,7 @@ nsPermissionManager::Init()
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mObserverService->AddObserver(this, "profile-before-change", true);
|
||||
mObserverService->AddObserver(this, "profile-do-change", true);
|
||||
mObserverService->AddObserver(this, "xpcom-shutdown", true);
|
||||
}
|
||||
|
||||
if (IsChildProcess()) {
|
||||
@ -1494,10 +1495,11 @@ NS_IMETHODIMP nsPermissionManager::Observe(nsISupports *aSubject, const char *aT
|
||||
mIsShuttingDown = true;
|
||||
RemoveAllFromMemory();
|
||||
CloseDB(false);
|
||||
}
|
||||
else if (!nsCRT::strcmp(aTopic, "profile-do-change")) {
|
||||
} else if (!nsCRT::strcmp(aTopic, "profile-do-change")) {
|
||||
// the profile has already changed; init the db from the new location
|
||||
InitDB(false);
|
||||
} else if (!nsCRT::strcmp(aTopic, "xpcom-shutdown")) {
|
||||
mObserverService = nullptr;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user