Fix memory leaks in system_server
unlink DeathRecipients in a whole bunch of places to avoid memory leaks
This commit is contained in:
@@ -53,6 +53,12 @@ public class LocationProviderProxy implements IBinder.DeathRecipient {
|
||||
}
|
||||
}
|
||||
|
||||
public void unlinkProvider() {
|
||||
if (mProvider != null) {
|
||||
mProvider.asBinder().unlinkToDeath(this, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return mName;
|
||||
}
|
||||
@@ -255,5 +261,6 @@ public class LocationProviderProxy implements IBinder.DeathRecipient {
|
||||
public void binderDied() {
|
||||
Log.w(TAG, "Location Provider " + mName + " died");
|
||||
mDead = true;
|
||||
mProvider.asBinder().unlinkToDeath(this, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user