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

Commit 96251e23 authored by Pawin Vongmasa's avatar Pawin Vongmasa Committed by android-build-merger
Browse files

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

am: 966c1587

Change-Id: I404e1023168bce78e094714a5187dfc30a491855
parents 1f65e9a2 966c1587
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();
}