Merge "Fixing a leak in WallpaperColorInfo" into sc-dev am: 419c1092e3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14020290 Change-Id: Id8a5f3c0373e2a0d8ee9bab9f9e617766cfe59a2
This commit is contained in:
@@ -102,9 +102,11 @@ public class WallpaperColorInfo implements OnColorsChangedListener {
|
||||
private void notifyChange() {
|
||||
// Create a new array to avoid concurrent modification when the activity destroys itself.
|
||||
mTempListeners = mListeners.toArray(mTempListeners);
|
||||
for (OnChangeListener listener : mTempListeners) {
|
||||
for (int i = mTempListeners.length - 1; i >= 0; --i) {
|
||||
final OnChangeListener listener = mTempListeners[i];
|
||||
if (listener != null) {
|
||||
listener.onExtractedColorsChanged(this);
|
||||
mTempListeners[i] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user