summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Pablo Ceballos <pceballos@google.com> 2016-03-04 17:54:21 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2016-03-04 17:54:21 +0000
commit99dccfc3ec4b304d1ee3497ecbcc3322a84cf606 (patch)
tree25da3c9371f342cca93e60e374fe2e6205eaec07
parent9018f173702c80336f66cfc1bdad3046698325a1 (diff)
parent8ea4e7b878540647bb7ceeaa1d62d50cd458d9c6 (diff)
Merge "Revert "SF: detachLayer from Client earlier on destruction"" into nyc-dev
-rw-r--r--services/surfaceflinger/Layer.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 77d9d0fb03..99f0f0b725 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -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();
}