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

Commit b41cd310 authored by Rob Carr's avatar Rob Carr Committed by android-build-merger
Browse files

Merge "SurfaceControl: Close CloseGuard when destroying surface in...

Merge "SurfaceControl: Close CloseGuard when destroying surface in transaction." into pi-dev am: 625de775
am: 15d55c26

Change-Id: I015977e3c79f0fe19fc60d028770fa00a9a669b8
parents 87d531ed 15d55c26
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -1580,6 +1580,20 @@ public class SurfaceControl implements Parcelable {
         */
        public Transaction destroy(SurfaceControl sc) {
            sc.checkNotReleased();

            /**
             * Perhaps it's safer to transfer the close guard to the Transaction
             * but then we have a whole wonky scenario regarding merging, multiple
             * close-guards per transaction etc...the whole scenario is kind of wonky
             * and it seems really we'd like to just be able to call release here
             * but the WindowManager has some code that looks like
             * --- destroyInTransaction(a)
             * --- reparentChildrenInTransaction(a)
             * so we need to ensure the SC remains valid until the transaction
             * is applied.
             */
            sc.mCloseGuard.close();

            nativeDestroy(mNativeObject, sc.mNativeObject);
            return this;
        }