diff options
| author | 2011-12-02 18:33:14 -0800 | |
|---|---|---|
| committer | 2011-12-02 18:33:14 -0800 | |
| commit | a91e54fed6a0690d59c97bab9b081b2614880563 (patch) | |
| tree | 84410ebb990b55ec74f7b85999d993c240dfa062 /services/surfaceflinger/SurfaceFlinger.cpp | |
| parent | 00f1ac8001b2bfe2ab70730d9c039ca4e633a2c2 (diff) | |
| parent | f57c1388860486a70cc773f2cfeaa3ea3b38a473 (diff) | |
am f57c1388: Merge "SurfaceFlinger: fix layer removal race condition" into ics-mr1
* commit 'f57c1388860486a70cc773f2cfeaa3ea3b38a473':
SurfaceFlinger: fix layer removal race condition
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index f38e94814587..24bd2a63ed61 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -710,6 +710,14 @@ void SurfaceFlinger::computeVisibleRegions( void SurfaceFlinger::commitTransaction() { + if (!mLayersPendingRemoval.isEmpty()) { + // Notify removed layers now that they can't be drawn from + for (size_t i = 0; i < mLayersPendingRemoval.size(); i++) { + mLayersPendingRemoval[i]->onRemoved(); + } + mLayersPendingRemoval.clear(); + } + mDrawingState = mCurrentState; mTransationPending = false; mTransactionCV.broadcast(); @@ -1162,7 +1170,7 @@ status_t SurfaceFlinger::purgatorizeLayer_l(const sp<LayerBase>& layerBase) mLayerPurgatory.add(layerBase); } - layerBase->onRemoved(); + mLayersPendingRemoval.push(layerBase); // it's possible that we don't find a layer, because it might // have been destroyed already -- this is not technically an error |