зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 5be07e86738e (bug 1439383) for causing leaks (bug 1401883). a=backout
This commit is contained in:
Родитель
91c9d08e42
Коммит
0ae0457289
|
@ -1016,23 +1016,6 @@ LoadLoadableRootsTask::Dispatch()
|
|||
NS_IMETHODIMP
|
||||
LoadLoadableRootsTask::Run()
|
||||
{
|
||||
// First we Run() on the "LoadRoots" thread, do our work, and then we Run()
|
||||
// again on the main thread so we can shut down the thread (since we don't
|
||||
// need it any more). We can't shut down the thread while we're *on* the
|
||||
// thread, which is why we do the dispatch to the main thread. CryptoTask.cpp
|
||||
// (which informs this code) says that we can't null out mThread. This appears
|
||||
// to be because its refcount could be decreased while this dispatch is being
|
||||
// processed, so it might get prematurely destroyed. I'm not sure this makes
|
||||
// sense but it'll get cleaned up in our destructor anyway, so it's fine to
|
||||
// not null it out here (as long as we don't run twice on the main thread,
|
||||
// which shouldn't be possible).
|
||||
if (NS_IsMainThread()) {
|
||||
if (mThread) {
|
||||
mThread->Shutdown();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult rv = LoadLoadableRoots();
|
||||
if (NS_FAILED(rv)) {
|
||||
MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("LoadLoadableRoots failed"));
|
||||
|
@ -1060,9 +1043,7 @@ LoadLoadableRootsTask::Run()
|
|||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
// Go back to the main thread to clean up this worker thread.
|
||||
return NS_DispatchToMainThread(this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
Загрузка…
Ссылка в новой задаче