Release SC when RootTaskDA is no longer organized

WM Shell receives a leash for the DA that it wants to organize. However,
it's not releasing the SC when it receives a vanished callback. This
causes the SC to leak every time a new RootTaskDA is organized and then
vanishes.

Test: Add and remove simulated displays. Ensure no leaks
Bug: 231752353
Change-Id: I181695f4bae65ccc0cd25e1b5480e33307e7834d
This commit is contained in:
chaviw
2022-05-31 16:47:55 -05:00
parent 91d28d1b21
commit 08a48506b0

View File

@@ -145,6 +145,8 @@ public class RootTaskDisplayAreaOrganizer extends DisplayAreaOrganizer {
}
mDisplayAreasInfo.remove(displayId);
mLeashes.get(displayId).release();
mLeashes.remove(displayId);
ArrayList<RootTaskDisplayAreaListener> listeners = mListeners.get(displayId);
if (listeners != null) {