diff options
| author | 2011-06-07 15:02:53 -0700 | |
|---|---|---|
| committer | 2011-06-07 15:02:53 -0700 | |
| commit | c8c39b6c5b14bbe17fbd0ffe4f3524f68a0caa10 (patch) | |
| tree | 90b55bb17f6be298ef7fafcdab0af801391e9668 | |
| parent | 92593dc49b348c4951037a1ae2fa17bb6644ffb9 (diff) | |
| parent | a6a4a9ed46d02ec0c6493a97cd1d3351bdcced63 (diff) | |
am a6a4a9ed: am f6c82067: fix a surface leak introduced by a failed merge (DO NOT MERGE)
* commit 'a6a4a9ed46d02ec0c6493a97cd1d3351bdcced63':
fix a surface leak introduced by a failed merge (DO NOT MERGE)
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 9a312a7369fe..a7b58576924c 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)); } |