Bug 1063541 - Destroy singleton NetworkManager object when requested. r=mfinkle, a=lmandel
authorWes Johnston <wjohnston@mozilla.com>
Thu, 25 Sep 2014 13:05:00 -0700
changeset 225253 fd7ee4fab0a116052230dbfda574e338d40fcb53
parent 225252 87a15344376935b78d951fff0791540d8744e3a9
child 225254 e10f2bc2dd0017a79f766908b0fc10565bc1db2a
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, lmandel
bugs1063541
milestone34.0a2
Bug 1063541 - Destroy singleton NetworkManager object when requested. r=mfinkle, a=lmandel
mobile/android/base/GeckoNetworkManager.java
--- a/mobile/android/base/GeckoNetworkManager.java
+++ b/mobile/android/base/GeckoNetworkManager.java
@@ -32,21 +32,22 @@ import android.util.Log;
  * Current connection is firstly obtained from Android's ConnectivityManager,
  * which is represented by the constant, and then will be mapped into the
  * connection type defined in Network Information API version 3.
  */
 
 public class GeckoNetworkManager extends BroadcastReceiver implements NativeEventListener {
     private static final String LOGTAG = "GeckoNetworkManager";
 
-    static private final GeckoNetworkManager sInstance = new GeckoNetworkManager();
+    static private GeckoNetworkManager sInstance = new GeckoNetworkManager();
 
     public static void destroy() {
         if (sInstance != null) {
             sInstance.onDestroy();
+            sInstance = null;
         }
     }
 
     // Connection Type defined in Network Information API v3.
     private enum ConnectionType {
         CELLULAR(0),
         BLUETOOTH(1),
         ETHERNET(2),