am 54af78a3: Merge change 5950 into donut
Merge commit '54af78a3f7064e04d7ebd64c985d4149f9f7b05c' * commit '54af78a3f7064e04d7ebd64c985d4149f9f7b05c': Fix memory leaks in system_server
This commit is contained in:
committed by
The Android Open Source Project
commit
0d0012ef16
@@ -1883,7 +1883,9 @@ public class WifiService extends IWifiManager.Stub {
|
||||
private WifiLock removeLock(IBinder binder) {
|
||||
int index = findLockByBinder(binder);
|
||||
if (index >= 0) {
|
||||
return mList.remove(index);
|
||||
WifiLock ret = mList.remove(index);
|
||||
ret.unlinkDeathRecipient();
|
||||
return ret;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@@ -1995,6 +1997,10 @@ public class WifiService extends IWifiManager.Stub {
|
||||
binderDied();
|
||||
}
|
||||
}
|
||||
|
||||
void unlinkDeathRecipient() {
|
||||
mBinder.unlinkToDeath(this, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private class Multicaster extends DeathRecipient {
|
||||
@@ -2062,7 +2068,10 @@ public class WifiService extends IWifiManager.Stub {
|
||||
|
||||
private void removeMulticasterLocked(int i, int uid)
|
||||
{
|
||||
mMulticasters.remove(i);
|
||||
Multicaster removed = mMulticasters.remove(i);
|
||||
if (removed != null) {
|
||||
removed.unlinkDeathRecipient();
|
||||
}
|
||||
if (mMulticasters.size() == 0) {
|
||||
WifiNative.startPacketFiltering();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user