OSDN Git Service

Revert "SF: detachLayer from Client earlier on destruction"
authorPablo Ceballos <pceballos@google.com>
Thu, 3 Mar 2016 23:20:02 +0000 (15:20 -0800)
committerThe Android Automerger <android-build@google.com>
Fri, 4 Mar 2016 19:25:20 +0000 (11:25 -0800)
This reverts commit e338df1c2ff4ed2cd575a0e3193ef77c9cd9cb72.

Bug 27330889

Change-Id: I7e62ac2623bd0e1304f36a895ee2b5f9160e2a7e

services/surfaceflinger/Layer.cpp

index 04256e1..9d4e90c 100644 (file)
@@ -165,6 +165,11 @@ void Layer::onFirstRef() {
 }
 
 Layer::~Layer() {
+  sp<Client> c(mClientRef.promote());
+    if (c != 0) {
+        c->detachLayer(this);
+    }
+
     for (auto& point : mRemoteSyncPoints) {
         point->setTransactionApplied();
     }
@@ -260,10 +265,6 @@ 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();
 }