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

Commit 71d62f25 authored by Houxiang Dai's avatar Houxiang Dai Committed by Cherrypicker Worker
Browse files

Fix some memory leakage

Remove MediaCodec sPoll buffer leakage

Test:
DTV input source stress test pass

Bug: 279135364, 235185556
(cherry picked from https://android-review.googlesource.com/q/commit:dfd125dc25fef939f6232f8c6cb59a6a6ffa7733)
Merged-In: I751beaeba39eeabd2c6aa9059b51997130dbf86b
Change-Id: I751beaeba39eeabd2c6aa9059b51997130dbf86b
parent 6e439da5
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -3181,8 +3181,11 @@ final public class MediaCodec {
                mValid = false;
                mNativeContext = 0;
            }

            if (!mInternal) {
                sPool.offer(this);
            }
        }

        private native void native_recycle();

@@ -3245,6 +3248,7 @@ final public class MediaCodec {
            mNativeContext = context;
            mMappable = isMappable;
            mValid = (context != 0);
            mInternal = true;
        }

        private static final BlockingQueue<LinearBlock> sPool =
@@ -3255,6 +3259,7 @@ final public class MediaCodec {
        private boolean mMappable = false;
        private ByteBuffer mMapped = null;
        private long mNativeContext = 0;
        private boolean mInternal = false;
    }

    /**