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

Commit 966c1587 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Stop GraphicBufferSource's looper without locking" into pi-dev

parents 6e64137e 2b0ee672
Loading
Loading
Loading
Loading
+22 −17
Original line number Diff line number Diff line
@@ -421,12 +421,14 @@ Status GraphicBufferSource::stop() {
}

Status GraphicBufferSource::release(){
    sp<ALooper> looper;
    {
        Mutex::Autolock autoLock(mMutex);
        looper = mLooper;
        if (mLooper != NULL) {
            mLooper->unregisterHandler(mReflector->id());
            mReflector.clear();

        mLooper->stop();
            mLooper.clear();
        }

@@ -440,7 +442,10 @@ Status GraphicBufferSource::release(){
        mLatestBuffer.mBuffer.reset();
        mComponent.clear();
        mExecuting = false;

    }
    if (looper != NULL) {
        looper->stop();
    }
    return Status::ok();
}