Bug 719851 - Remove Flash view on Android when plugin instance is lost r=blassey
authorJames Willcox <jwillcox@mozilla.com>
Wed, 14 Mar 2012 17:15:46 -0400
changeset 89402 caf297562dcb9fb59619b7b2db7977587f73b2e0
parent 89401 5217bbf42aa71da726a40175975a13880ee519e8
child 89403 dc72c4a740246fcd9662e4507aa7fbf69de0de94
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersblassey
bugs719851
milestone14.0a1
Bug 719851 - Remove Flash view on Android when plugin instance is lost r=blassey
dom/plugins/base/nsPluginInstanceOwner.cpp
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -410,19 +410,24 @@ NS_IMPL_ISUPPORTS3(nsPluginInstanceOwner
 nsresult
 nsPluginInstanceOwner::SetInstance(nsNPAPIPluginInstance *aInstance)
 {
   NS_ASSERTION(!mInstance || !aInstance, "mInstance should only be set or unset!");
 
   // 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;
 }
 
 NS_IMETHODIMP nsPluginInstanceOwner::GetWindow(NPWindow *&aWindow)
 {
   NS_ASSERTION(mPluginWindow, "the plugin window object being returned is null");