Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67f210f7 authored by Luca Zuccarini's avatar Luca Zuccarini
Browse files

Fix NPE when reparenting a leash that has already been released.

TIL that even when reparenting to null, the leash has to be valid (i.e.
have an underlying native object associated to it). This is only true
when the leash has not yet been released.

Fix: 404507270
Flag: EXEMPT bugfix
Test: manual
Change-Id: I9fa182cec821e838bfe1ef7769f1a7405291019e
parent 0955ae43
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -199,8 +199,10 @@ public abstract class RemoteAnimationRunnerCompat extends IRemoteAnimationRunner
                    info.releaseAllSurfaces();
                    // Make sure that the transition leashes created are not leaked.
                    for (SurfaceControl leash : leashMap.values()) {
                        if (leash.isValid()) {
                            finishTransaction.reparent(leash, null);
                        }
                    }
                    // Don't release here since launcher might still be using them. Instead
                    // let launcher release them (eg. via RemoteAnimationTargets)
                    leashMap.clear();