mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 1187146 - Replace nsBaseHashtable::Enumerate() calls in js/xpconnect/ with iterators. r=mrbkap.
--HG-- extra : rebase_source : 28dc3c5614ee36e6e6955b9cc380e85ccc618a0d
This commit is contained in:
parent
be3147c152
commit
4dd2a30a0f
@ -964,13 +964,6 @@ mozJSComponentLoader::ObjectForLocation(ComponentLoaderInfo& aInfo,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* static */ PLDHashOperator
|
||||
mozJSComponentLoader::ClearModules(const nsACString& key, ModuleEntry*& entry, void* cx)
|
||||
{
|
||||
entry->Clear();
|
||||
return PL_DHASH_REMOVE;
|
||||
}
|
||||
|
||||
void
|
||||
mozJSComponentLoader::UnloadModules()
|
||||
{
|
||||
@ -1000,7 +993,10 @@ mozJSComponentLoader::UnloadModules()
|
||||
mInProgressImports.Clear();
|
||||
mImports.Clear();
|
||||
|
||||
mModules.Enumerate(ClearModules, nullptr);
|
||||
for (auto iter = mModules.Iter(); !iter.Done(); iter.Next()) {
|
||||
iter.Data()->Clear();
|
||||
iter.Remove();
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -148,7 +148,6 @@ class mozJSComponentLoader : public mozilla::ModuleLoader,
|
||||
mozilla::MallocSizeOf aMallocSizeOf, void* arg);
|
||||
|
||||
// Modules are intentionally leaked, but still cleared.
|
||||
static PLDHashOperator ClearModules(const nsACString& key, ModuleEntry*& entry, void* cx);
|
||||
nsDataHashtable<nsCStringHashKey, ModuleEntry*> mModules;
|
||||
|
||||
nsClassHashtable<nsCStringHashKey, ModuleEntry> mImports;
|
||||
|
Loading…
Reference in New Issue
Block a user