Bug 1137906 - Shutdown cached children when shutdown the document. r=surkov

This commit is contained in:
Ting-Yu Chou 2015-03-10 11:24:26 +08:00
parent 714f54dae8
commit ebca8598ef

View File

@ -195,9 +195,17 @@ xpcAccessibleDocument::GetAccessible(Accessible* aAccessible)
return xpcAcc;
}
static PLDHashOperator
ShutdownAndRemove(const Accessible* aKey, nsRefPtr<xpcAccessibleGeneric>& aValue,
void* aUnused)
{
aValue->Shutdown();
return PL_DHASH_REMOVE;
}
void
xpcAccessibleDocument::Shutdown()
{
mCache.Clear();
mCache.Enumerate(ShutdownAndRemove, nullptr);
xpcAccessibleGeneric::Shutdown();
}