mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1002014 - Error case leak in AsmJSCache.cpp AllocEntryParent(); r=luke
This commit is contained in:
parent
d4400ed747
commit
b797941923
@ -1323,23 +1323,22 @@ AllocEntryParent(OpenMode aOpenMode,
|
||||
WriteParams aWriteParams,
|
||||
nsIPrincipal* aPrincipal)
|
||||
{
|
||||
ParentProcessRunnable* runnable =
|
||||
nsRefPtr<ParentProcessRunnable> runnable =
|
||||
new ParentProcessRunnable(aPrincipal, aOpenMode, aWriteParams);
|
||||
|
||||
// AddRef to keep the runnable alive until DeallocEntryParent.
|
||||
runnable->AddRef();
|
||||
|
||||
nsresult rv = NS_DispatchToMainThread(runnable);
|
||||
NS_ENSURE_SUCCESS(rv, nullptr);
|
||||
|
||||
return runnable;
|
||||
// Transfer ownership to IPDL.
|
||||
return runnable.forget().take();
|
||||
}
|
||||
|
||||
void
|
||||
DeallocEntryParent(PAsmJSCacheEntryParent* aActor)
|
||||
{
|
||||
// Match the AddRef in AllocEntryParent.
|
||||
static_cast<ParentProcessRunnable*>(aActor)->Release();
|
||||
// Transfer ownership back from IPDL.
|
||||
nsRefPtr<ParentProcessRunnable> op =
|
||||
dont_AddRef(static_cast<ParentProcessRunnable*>(aActor));
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
Loading…
Reference in New Issue
Block a user