summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-06-07 14:52:22 -0700
committerMathias Agopian <mathias@google.com>2011-06-07 14:52:22 -0700
commitf6c8206735e7e078461e5f2aef6e1a1446fdd075 (patch)
tree5fdf591e3639785e8199a557e17213cbb22d07ef /services
parent8de47a2f25a9379c44f220f0bd0f25585bfbc9fb (diff)
downloadframeworks_base-f6c8206735e7e078461e5f2aef6e1a1446fdd075.zip
frameworks_base-f6c8206735e7e078461e5f2aef6e1a1446fdd075.tar.gz
frameworks_base-f6c8206735e7e078461e5f2aef6e1a1446fdd075.tar.bz2
fix a surface leak introduced by a failed merge (DO NOT MERGE)
Bug: 4558502 Change-Id: Ibf889d03caa806c34603ad45f135b78c3851f55c
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 9a312a7..a7b5857 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1389,6 +1389,14 @@ status_t SurfaceFlinger::destroySurface(const wp<LayerBaseClient>& layer)
if (l != NULL) {
Mutex::Autolock _l(mStateLock);
err = removeLayer_l(l);
+ if (err == NAME_NOT_FOUND) {
+ // The surface wasn't in the current list, which means it was
+ // removed already, which means it is in the purgatory,
+ // and need to be removed from there.
+ ssize_t idx = mLayerPurgatory.remove(l);
+ LOGE_IF(idx < 0,
+ "layer=%p is not in the purgatory list", l.get());
+ }
LOGE_IF(err<0 && err != NAME_NOT_FOUND,
"error removing layer=%p (%s)", l.get(), strerror(-err));
}