OSDN Git Service

Fix memory leak in Connectivity Service when phone app crashes
authorMaunik Shah <mshah@codeaurora.org>
Mon, 30 Mar 2015 06:06:42 +0000 (11:36 +0530)
committerMaunik Shah <mshah@codeaurora.org>
Sat, 4 Apr 2015 16:18:24 +0000 (21:48 +0530)
Upon crash of com.android.phone process, NetworkFactoryInfo is
not getting removed from HashMap and will get accumulated on
every start of the process.

Change-Id: Iafde28daddfc82728c03208522682b1efc85a121

services/core/java/com/android/server/ConnectivityService.java

index d9ef766..758b0fc 100644 (file)
@@ -2022,6 +2022,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
                         ReapUnvalidatedNetworks.DONT_REAP);
             }
         }
+        NetworkFactoryInfo nfi = mNetworkFactoryInfos.remove(msg.replyTo);
+        if (DBG && nfi != null) log("unregisterNetworkFactory for " + nfi.name);
     }
 
     // If this method proves to be too slow then we can maintain a separate