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

Commit 799a0d81 authored by Marissa Wall's avatar Marissa Wall Committed by android-build-merger
Browse files

Merge "blast: fix leak on BufferStateLayer death" into qt-dev am: 6990af63 am: f5d22cff

am: 7879cacc

Change-Id: I79fe602bf5e27608b343e926e098a6e73326ad3a
parents e0eed55e 7879cacc
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -228,8 +228,14 @@ status_t TransactionCompletedThread::addCallbackHandle(const sp<CallbackHandle>&
    }

    transactionStats->latchTime = handle->latchTime;
    transactionStats->surfaceStats.emplace_back(handle->surfaceControl, handle->acquireTime,
    // If the layer has already been destroyed, don't add the SurfaceControl to the callback.
    // The client side keeps a sp<> to the SurfaceControl so if the SurfaceControl has been
    // destroyed the client side is dead and there won't be anyone to send the callback to.
    sp<IBinder> surfaceControl = handle->surfaceControl.promote();
    if (surfaceControl) {
        transactionStats->surfaceStats.emplace_back(surfaceControl, handle->acquireTime,
                                                    handle->previousReleaseFence);
    }
    return NO_ERROR;
}

+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ public:

    sp<ITransactionCompletedListener> listener;
    std::vector<CallbackId> callbackIds;
    sp<IBinder> surfaceControl;
    wp<IBinder> surfaceControl;

    bool releasePreviousBuffer = false;
    sp<Fence> previousReleaseFence;