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

This commit is contained in:
Josh Aas 2011-11-01 14:52:20 -04:00
Родитель 24f59fb48a
Коммит 021a865c91
1 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -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;
}