File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -710,6 +710,14 @@ void SurfaceFlinger::computeVisibleRegions(
710710
711711void SurfaceFlinger::commitTransaction ()
712712{
713+ if (!mLayersPendingRemoval .isEmpty ()) {
714+ // Notify removed layers now that they can't be drawn from
715+ for (size_t i = 0 ; i < mLayersPendingRemoval .size (); i++) {
716+ mLayersPendingRemoval [i]->onRemoved ();
717+ }
718+ mLayersPendingRemoval .clear ();
719+ }
720+
713721 mDrawingState = mCurrentState ;
714722 mTransationPending = false ;
715723 mTransactionCV .broadcast ();
@@ -1162,7 +1170,7 @@ status_t SurfaceFlinger::purgatorizeLayer_l(const sp<LayerBase>& layerBase)
11621170 mLayerPurgatory .add (layerBase);
11631171 }
11641172
1165- layerBase-> onRemoved ( );
1173+ mLayersPendingRemoval . push (layerBase );
11661174
11671175 // it's possible that we don't find a layer, because it might
11681176 // have been destroyed already -- this is not technically an error
Original file line number Diff line number Diff line change @@ -345,6 +345,7 @@ class SurfaceFlinger :
345345 Condition mTransactionCV ;
346346 SortedVector< sp<LayerBase> > mLayerPurgatory ;
347347 bool mTransationPending ;
348+ Vector< sp<LayerBase> > mLayersPendingRemoval ;
348349
349350 // protected by mStateLock (but we could use another lock)
350351 GraphicPlane mGraphicPlanes [1 ];
You can’t perform that action at this time.
0 commit comments