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

Commit 96a715f5 authored by Rob Carr's avatar Rob Carr Committed by Android (Google) Code Review
Browse files

Merge "Ensure onHandleDestroyed drops reference before releasing lock."

parents 9acbb39d 695d5286
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3911,10 +3911,11 @@ void SurfaceFlinger::markLayerPendingRemovalLocked(const Mutex&, const sp<Layer>
    setTransactionFlags(eTransactionNeeded);
}

void SurfaceFlinger::onHandleDestroyed(const sp<Layer>& layer)
void SurfaceFlinger::onHandleDestroyed(sp<Layer>& layer)
{
    Mutex::Autolock lock(mStateLock);
    markLayerPendingRemovalLocked(mStateLock, layer);
    layer.clear();
}

// ---------------------------------------------------------------------------
+1 −1
Original line number Diff line number Diff line
@@ -601,7 +601,7 @@ private:
    // called when all clients have released all their references to
    // this layer meaning it is entirely safe to destroy all
    // resources associated to this layer.
    void onHandleDestroyed(const sp<Layer>& layer);
    void onHandleDestroyed(sp<Layer>& layer);

    // remove a layer from SurfaceFlinger immediately
    status_t removeLayer(const sp<Layer>& layer);