Ringtone: clear the MediaPlayer listener upon completion
This breaks a local refcount cycle and allows the Java gc to finalize the Ringtone and MediaPlayer objects quickly. Bug: 31811091 Change-Id: I0e5a4a78fdc02cc0c8b7811a1f1a45db3c90a0ff
This commit is contained in:
@@ -469,6 +469,7 @@ public class Ringtone {
|
||||
synchronized (sActiveRingtones) {
|
||||
sActiveRingtones.remove(Ringtone.this);
|
||||
}
|
||||
mp.setOnCompletionListener(null); // Help the Java GC: break the refcount cycle.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user