diff options
author | Olawale Ogunwale <ogunwale@google.com> | 2015-04-06 15:25:03 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-04-06 15:25:04 +0000 |
commit | 47c1cf4b35616059409a0674382c2318494e877b (patch) | |
tree | e7ca4596c908505b5a98810788bfce62dceb719f /services | |
parent | 655ef08144ec0b71a98b6b3a38e50c6b346ae467 (diff) | |
parent | 40e259c34078945ac298c7b20f1df4bef25c3453 (diff) | |
download | frameworks_base-47c1cf4b35616059409a0674382c2318494e877b.zip frameworks_base-47c1cf4b35616059409a0674382c2318494e877b.tar.gz frameworks_base-47c1cf4b35616059409a0674382c2318494e877b.tar.bz2 |
Merge "[ActivityManager] Fix ServiceRecord leakage"
Diffstat (limited to 'services')
-rwxr-xr-x | services/core/java/com/android/server/am/ActiveServices.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index 059dde1..a9d6a69 100755 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java @@ -2127,8 +2127,16 @@ public final class ActiveServices { } } - // First clear app state from services. - for (int i=app.services.size()-1; i>=0; i--) { + // Clean up any connections this application has to other services. + for (int i = app.connections.size() - 1; i >= 0; i--) { + ConnectionRecord r = app.connections.valueAt(i); + removeConnectionLocked(r, app, null); + } + updateServiceConnectionActivitiesLocked(app); + app.connections.clear(); + + // Clear app state from services. + for (int i = app.services.size() - 1; i >= 0; i--) { ServiceRecord sr = app.services.valueAt(i); synchronized (sr.stats.getBatteryStats()) { sr.stats.stopLaunchedLocked(); @@ -2188,14 +2196,6 @@ public final class ActiveServices { } } - // Clean up any connections this application has to other services. - for (int i=app.connections.size()-1; i>=0; i--) { - ConnectionRecord r = app.connections.valueAt(i); - removeConnectionLocked(r, app, null); - } - updateServiceConnectionActivitiesLocked(app); - app.connections.clear(); - ServiceMap smap = getServiceMap(app.userId); // Now do remaining service cleanup. |