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

Commit c0fb0446 authored by Sungtak Lee's avatar Sungtak Lee Committed by Automerger Merge Worker
Browse files

CCodec: Delay stop using surface until the end of release() am: 58c38129

parents 90f6900f 58c38129
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1973,7 +1973,6 @@ void CCodec::initiateRelease(bool sendCallback /* = true */) {
    }

    mChannel->reset();
    mChannel->stopUseOutputSurface();
    // thiz holds strong ref to this while the thread is running.
    sp<CCodec> thiz(this);
    std::thread([thiz, sendCallback] { thiz->release(sendCallback); }).detach();
@@ -1994,6 +1993,7 @@ void CCodec::release(bool sendCallback) {
        comp = state->comp;
    }
    comp->release();
    mChannel->stopUseOutputSurface();

    {
        Mutexed<State>::Locked state(mState);