Bug 562442: Plugin crash fix (parent process). r=jmathies

This commit is contained in:
Josh Aas 2011-11-01 14:52:20 -04:00
parent b128768901
commit f1269e3c00

View File

@ -827,8 +827,13 @@ nsObjectFrame::CallSetWindow(bool aCheckIsHidden)
window->width = intBounds.width;
window->height = intBounds.height;
// this will call pi->SetWindow and take care of window subclassing
// if needed, see bug 132759.
// Calling SetWindow might destroy this frame. We need to use the instance
// owner to clean up so hold a ref.
nsRefPtr<nsPluginInstanceOwner> instanceOwnerRef(mInstanceOwner);
// This will call pi->SetWindow and take care of window subclassing
// if needed, see bug 132759. Calling SetWindow can destroy this frame
// so check for that before doing anything else with this frame's memory.
if (mInstanceOwner->UseAsyncRendering()) {
rv = pi->AsyncSetWindow(window);
}
@ -836,7 +841,8 @@ nsObjectFrame::CallSetWindow(bool aCheckIsHidden)
rv = window->CallSetWindow(pi);
}
mInstanceOwner->ReleasePluginPort(window->window);
instanceOwnerRef->ReleasePluginPort(window->window);
return rv;
}