Merge "Revert "SF: detachLayer from Client earlier on destruction"" into nyc-dev
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 77d9d0f..99f0f0b 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -165,6 +165,11 @@
}
Layer::~Layer() {
+ sp<Client> c(mClientRef.promote());
+ if (c != 0) {
+ c->detachLayer(this);
+ }
+
for (auto& point : mRemoteSyncPoints) {
point->setTransactionApplied();
}
@@ -260,10 +265,6 @@
// 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();
}