[wm] Explicitly release surfacecontrol in mirrorDisplay
Don't rely on GC to release the surfacecontrol. If we stress the API like in the case of tests, we may end up not freeing resources in time and crash the system. Test: test magnifier Bug: 279622227 Change-Id: Id70c9387bce0d0e92d40cccdeaab232b9c61d7e8
This commit is contained in:
@@ -9014,7 +9014,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
|
||||
final SurfaceControl mirror = SurfaceControl.mirrorSurface(displaySc);
|
||||
outSurfaceControl.copyFrom(mirror, "WMS.mirrorDisplay");
|
||||
|
||||
mirror.release();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user