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

Commit 69d2a84e authored by Dan Stoza's avatar Dan Stoza Committed by Android (Google) Code Review
Browse files

Merge "SF: detachLayer from Client earlier on destruction"

parents 2fb01727 e338df1c
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -147,10 +147,6 @@ void Layer::onFirstRef() {
}

Layer::~Layer() {
    sp<Client> c(mClientRef.promote());
    if (c != 0) {
        c->detachLayer(this);
    }
    mFlinger->deleteTextureAsync(mTextureName);
    mFrameTracker.logAndResetStats(mName);
}
@@ -252,6 +248,10 @@ void Layer::onSidebandStreamChanged() {
// the layer has been remove from the current state list (and just before
// it's removed from the drawing state list)
void Layer::onRemoved() {
    sp<Client> c(mClientRef.promote());
    if (c != 0) {
        c->detachLayer(this);
    }
    mSurfaceFlingerConsumer->abandon();
}