зеркало из https://github.com/mozilla/gecko-dev.git
Bug 615149 - Crash under nsAccDocManager::ClearDocCache. r=surkov, a=davidb
This commit is contained in:
Родитель
c13f3e04fa
Коммит
db90450a96
|
@ -491,17 +491,25 @@ nsAccDocManager::CreateDocOrRootAccessible(nsIDocument *aDocument)
|
|||
// nsAccDocManager static
|
||||
|
||||
PLDHashOperator
|
||||
nsAccDocManager::ClearDocCacheEntry(const nsIDocument* aKey,
|
||||
nsRefPtr<nsDocAccessible>& aDocAccessible,
|
||||
void* aUserArg)
|
||||
nsAccDocManager::GetFirstEntryInDocCache(const nsIDocument* aKey,
|
||||
nsDocAccessible* aDocAccessible,
|
||||
void* aUserArg)
|
||||
{
|
||||
NS_ASSERTION(aDocAccessible,
|
||||
"Calling ClearDocCacheEntry with a NULL pointer!");
|
||||
"No doc accessible for the object in doc accessible cache!");
|
||||
*reinterpret_cast<nsDocAccessible**>(aUserArg) = aDocAccessible;
|
||||
|
||||
if (aDocAccessible)
|
||||
aDocAccessible->Shutdown();
|
||||
return PL_DHASH_STOP;
|
||||
}
|
||||
|
||||
return PL_DHASH_REMOVE;
|
||||
void
|
||||
nsAccDocManager::ClearDocCache()
|
||||
{
|
||||
nsDocAccessible* docAcc = nsnull;
|
||||
while (mDocAccessibleCache.EnumerateRead(GetFirstEntryInDocCache, static_cast<void*>(&docAcc))) {
|
||||
if (docAcc)
|
||||
docAcc->Shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
PLDHashOperator
|
||||
|
|
|
@ -152,20 +152,17 @@ private:
|
|||
nsDocAccessibleHashtable;
|
||||
|
||||
/**
|
||||
* Shutdown and remove the document accessible from cache.
|
||||
* Get first entry of the document accessible from cache.
|
||||
*/
|
||||
static PLDHashOperator
|
||||
ClearDocCacheEntry(const nsIDocument* aKey,
|
||||
nsRefPtr<nsDocAccessible>& aDocAccessible,
|
||||
void* aUserArg);
|
||||
GetFirstEntryInDocCache(const nsIDocument* aKey,
|
||||
nsDocAccessible* aDocAccessible,
|
||||
void* aUserArg);
|
||||
|
||||
/**
|
||||
* Clear the cache and shutdown the document accessibles.
|
||||
*/
|
||||
void ClearDocCache()
|
||||
{
|
||||
mDocAccessibleCache.Enumerate(ClearDocCacheEntry, static_cast<void*>(this));
|
||||
}
|
||||
void ClearDocCache();
|
||||
|
||||
struct nsSearchAccessibleInCacheArg
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче