зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1184419 - Part 2: Get rid of HRTFDatabaseLoader::shutdownEnumFunc; r=padenot
This commit is contained in:
Родитель
860198febf
Коммит
89d446ad7d
|
@ -205,14 +205,6 @@ void HRTFDatabaseLoader::waitForLoaderThreadCompletion()
|
|||
m_databaseLoaderThread = nullptr;
|
||||
}
|
||||
|
||||
PLDHashOperator
|
||||
HRTFDatabaseLoader::shutdownEnumFunc(LoaderByRateEntry *entry, void* unused)
|
||||
{
|
||||
// Ensure the loader thread's reference is removed for leak analysis.
|
||||
entry->mLoader->waitForLoaderThreadCompletion();
|
||||
return PLDHashOperator::PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
void HRTFDatabaseLoader::shutdown()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
@ -221,7 +213,9 @@ void HRTFDatabaseLoader::shutdown()
|
|||
// reference release during enumeration.
|
||||
nsTHashtable<LoaderByRateEntry>* loaderMap = s_loaderMap;
|
||||
s_loaderMap = nullptr;
|
||||
loaderMap->EnumerateEntries(shutdownEnumFunc, nullptr);
|
||||
for (auto iter = loaderMap->Iter(); !iter.Done(); iter.Next()) {
|
||||
iter.Get()->mLoader->waitForLoaderThreadCompletion();
|
||||
}
|
||||
delete loaderMap;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -129,9 +129,6 @@ private:
|
|||
HRTFDatabaseLoader* mLoader;
|
||||
};
|
||||
|
||||
static PLDHashOperator shutdownEnumFunc(LoaderByRateEntry *entry,
|
||||
void* unused);
|
||||
|
||||
// Keeps track of loaders on a per-sample-rate basis.
|
||||
static nsTHashtable<LoaderByRateEntry> *s_loaderMap; // singleton
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче