diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index 00c20293e7ed..4600587f6afd 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -415,9 +415,14 @@ nsPluginInstanceOwner::SetInstance(nsNPAPIPluginInstance *aInstance) // If we're going to null out mInstance after use, be sure to call // mInstance->InvalidateOwner() here, since it now won't be called // from our destructor. This fixes bug 613376. - if (mInstance && !aInstance) + if (mInstance && !aInstance) { mInstance->InvalidateOwner(); +#ifdef MOZ_WIDGET_ANDROID + RemovePluginView(); +#endif + } + mInstance = aInstance; return NS_OK;