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

Commit c6ae3c8a authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Fix theoretical memory leak in mConfigEvents

Change-Id: I137f70676c8919661e716c33e0dd9c25c2b6285c
parent ee5e8d3e
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,