Bug 602976 - Handle onDestroy better, r=blassey a=blocking-fennec
authorMichael Wu <mwu@mozilla.com>
Mon, 08 Nov 2010 18:11:18 -0800
changeset 57135 17bb9e21dfe1791fe2d24dbb77e8a0009701bb75
parent 57134 cf55a728ea5c66754a4e0a78e41b015ebae96cf2
child 57136 ed1d65957bd0039d9fb72805306542108e900cfe
push idunknown
push userunknown
push dateunknown
reviewersblassey, blocking-fennec
bugs602976
milestone2.0b8pre
Bug 602976 - Handle onDestroy better, r=blassey a=blocking-fennec
embedding/android/GeckoApp.java
--- a/embedding/android/GeckoApp.java
+++ b/embedding/android/GeckoApp.java
@@ -284,17 +284,18 @@ abstract public class GeckoApp
     }
 
     @Override
     public void onDestroy()
     {
         Log.i("GeckoApp", "destroy");
         // Tell Gecko to shutting down; we'll end up calling System.exit()
         // in onXreExit.
-        GeckoAppShell.sendEventToGecko(new GeckoEvent(GeckoEvent.ACTIVITY_STOPPING));
+        if (isFinishing())
+            GeckoAppShell.sendEventToGecko(new GeckoEvent(GeckoEvent.ACTIVITY_STOPPING));
 
         super.onDestroy();
     }
 
     @Override
     public void onConfigurationChanged(android.content.res.Configuration newConfig)
     {
         Log.i("GeckoApp", "configuration changed");