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

Commit c298f9c9 authored by John Reck's avatar John Reck
Browse files

Fix finalizer ordering/double-free issue

Bug: 18289984

If Surface:finalize() happens after HwuiContext:finalize()
it would try to manipulate a destroyed object. However, as
Surface:finalize() always calls HwuiContext:destroy() this
can be fixed by simply getting rid of HwuiContext's finalizer

Change-Id: I7c912214417ab32891b1c58d045c9721e5f01965
parent b9744c1c
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -603,15 +603,6 @@ public class Surface implements Parcelable {
                mHwuiRenderer = 0;
            }
        }

        @Override
        protected void finalize() throws Throwable {
            try {
                destroy();
            } finally {
                super.finalize();
            }
        }
    }

    private static native long nHwuiCreate(long rootNode, long surface);