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

Commit 9d7376a7 authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "Fix theoretical memory leak in mConfigEvents"

parents bea3d3e0 c6ae3c8a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -282,6 +282,12 @@ AudioFlinger::ThreadBase::ThreadBase(const sp<AudioFlinger>& audioFlinger, audio

AudioFlinger::ThreadBase::~ThreadBase()
{
    // mConfigEvents should be empty, but just in case it isn't, free the memory it owns
    for (size_t i = 0; i < mConfigEvents.size(); i++) {
        delete mConfigEvents[i];
    }
    mConfigEvents.clear();

    mParamCond.broadcast();
    // do not lock the mutex in destructor
    releaseWakeLock_l();
+1 −0
Original line number Diff line number Diff line
@@ -290,6 +290,7 @@ protected:
                Vector<String8>         mNewParameters;
                status_t                mParamStatus;

                // vector owns each ConfigEvent *, so must delete after removing
                Vector<ConfigEvent *>     mConfigEvents;

                // These fields are written and read by thread itself without lock or barrier,