зеркало из https://github.com/mozilla/pjs.git
Bug 22305. Fix leak when replacing cache entry for style sheet and prototype document. r=buster, a=sdagley
This commit is contained in:
Родитель
9084c00563
Коммит
bab94bfa5e
|
@ -146,7 +146,8 @@ nsXULPrototypeCache::PutPrototype(nsIXULPrototypeDocument* aDocument)
|
|||
rv = aDocument->GetURI(getter_AddRefs(uri));
|
||||
|
||||
nsIURIKey key(uri);
|
||||
mPrototypeTable.Put(&key, aDocument);
|
||||
nsIXULPrototypeDocument* oldproto = NS_STATIC_CAST(nsIXULPrototypeDocument*, mPrototypeTable.Put(&key, aDocument));
|
||||
NS_IF_RELEASE(oldproto);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -177,7 +178,8 @@ nsXULPrototypeCache::PutStyleSheet(nsICSSStyleSheet* aStyleSheet)
|
|||
rv = aStyleSheet->GetURL(*getter_AddRefs(uri));
|
||||
|
||||
nsIURIKey key(uri);
|
||||
mStyleSheetTable.Put(&key, aStyleSheet);
|
||||
nsICSSStyleSheet* oldsheet = NS_STATIC_CAST(nsICSSStyleSheet*, mStyleSheetTable.Put(&key, aStyleSheet));
|
||||
NS_IF_RELEASE(oldsheet);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -146,7 +146,8 @@ nsXULPrototypeCache::PutPrototype(nsIXULPrototypeDocument* aDocument)
|
|||
rv = aDocument->GetURI(getter_AddRefs(uri));
|
||||
|
||||
nsIURIKey key(uri);
|
||||
mPrototypeTable.Put(&key, aDocument);
|
||||
nsIXULPrototypeDocument* oldproto = NS_STATIC_CAST(nsIXULPrototypeDocument*, mPrototypeTable.Put(&key, aDocument));
|
||||
NS_IF_RELEASE(oldproto);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -177,7 +178,8 @@ nsXULPrototypeCache::PutStyleSheet(nsICSSStyleSheet* aStyleSheet)
|
|||
rv = aStyleSheet->GetURL(*getter_AddRefs(uri));
|
||||
|
||||
nsIURIKey key(uri);
|
||||
mStyleSheetTable.Put(&key, aStyleSheet);
|
||||
nsICSSStyleSheet* oldsheet = NS_STATIC_CAST(nsICSSStyleSheet*, mStyleSheetTable.Put(&key, aStyleSheet));
|
||||
NS_IF_RELEASE(oldsheet);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче