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

Commit 99ba7203 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Avoid leaking Surface native object." into jb-mr2-dev

parents b044c40c 21ef9647
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);