Bug 1520642 - Cancel dns requests before cleaning up db. r=kershaw

Differential Revision: https://phabricator.services.mozilla.com/D18989

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dragana Damjanovic 2019-02-08 09:34:34 +00:00
Родитель 3013aa2b9f
Коммит d26590be47
1 изменённых файлов: 3 добавлений и 4 удалений

Просмотреть файл

@ -778,6 +778,9 @@ void nsHostResolver::Shutdown() {
if (mNumIdleTasks) mIdleTaskCV.NotifyAll();
for (auto iter = mRecordDB.Iter(); !iter.Done(); iter.Next()) {
iter.UserData()->Cancel();
}
// empty host database
mRecordDB.Clear();
}
@ -797,10 +800,6 @@ void nsHostResolver::Shutdown() {
pendingQLow.clear();
evictionQ.clear();
for (auto iter = mRecordDB.Iter(); !iter.Done(); iter.Next()) {
iter.UserData()->Cancel();
}
// Shutdown the resolver threads, but with a timeout of 20 seconds.
// If the timeout is exceeded, any stuck threads will be leaked.
mResolverThreads->ShutdownWithTimeout(20 * 1000);