Bug 1336005 - Add null check when releasing and shutting down background thread r=francois

MozReview-Commit-ID: HKlQLqQH2c9
This commit is contained in:
Thomas Nguyen
2017-02-07 10:06:21 +08:00
parent 3714472b99
commit 8306f6ac3b

View File

@@ -1892,6 +1892,11 @@ nsUrlClassifierDBService::Observe(nsISupports *aSubject, const char *aTopic,
Shutdown();
LOG(("joining background thread"));
mWorkerProxy = nullptr;
if (!gDbBackgroundThread) {
return NS_OK;
}
nsIThread *backgroundThread = gDbBackgroundThread;
gDbBackgroundThread = nullptr;
backgroundThread->Shutdown();