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

Commit 09782e97 authored by Luca Zuccarini's avatar Luca Zuccarini
Browse files

Wrap reparent in a try-catch.

Apparently checking for validity is not enough, as there can be a
race condition that results in the leash being released between the
check and the reparent call. Wrapping in a try-catch and logging the
error instead to avoid crashing.

Fix: 404507270
Flag: EXEMPT bugfix
Test: manual
Change-Id: Ie5b0787ff6cb0262b03e43224e5652173f71b401
parent f6d3e7a7
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()) {
                        try {
                            finishTransaction.reparent(leash, null);
                        } catch (Exception e) {
                            Log.e(TAG, "Failed to reparent leash", e);
                        }
                    }
                    // Don't release here since launcher might still be using them. Instead