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

Commit 21ef9647 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Avoid leaking Surface native object.

Bug: 8721827
Change-Id: I8d6192b8eb47911fcf4964de399c7dba94ed9286
parent 7c98c196
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -389,10 +389,14 @@ final class ElectronBeam {
                mTexNamesGenerated = true;
            }

            SurfaceTexture st = new SurfaceTexture(mTexNames[0]);
            final SurfaceTexture st = new SurfaceTexture(mTexNames[0]);
            final Surface s = new Surface(st);
            try {
                SurfaceControl.screenshot(SurfaceControl.getBuiltInDisplay(
                    SurfaceControl.BUILT_IN_DISPLAY_ID_MAIN),
                    new Surface(st));
                        SurfaceControl.BUILT_IN_DISPLAY_ID_MAIN), s);
            } finally {
                s.release();
            }

            st.updateTexImage();
            st.getTransformMatrix(mTexMatrix);