Release the child layer on TaskSnapshot
Try to eliminante the offscreen layer from TaskSnapshot. When remove the task snapshot window, although the SurfaceControl has destroyed in WindowManager, but that layer seems still left as offscreen layer in SurfaceFlinger, a possible reason is there didn't release the copied layer so that reference keep it alive. Test: keep hot launch apps and monitor no TaskSnapshot layer left in offscreen layer. Bug: 192298258 Change-Id: I6beff78112da2309d4825e185bd960974892f5e8
This commit is contained in:
@@ -364,6 +364,7 @@ public class TaskSnapshotWindow {
|
||||
|
||||
// In case window manager leaks us, make sure we don't retain the snapshot.
|
||||
mSnapshot = null;
|
||||
mSurfaceControl.release();
|
||||
}
|
||||
|
||||
private void drawSizeMatchSnapshot() {
|
||||
@@ -431,6 +432,7 @@ public class TaskSnapshotWindow {
|
||||
mTransaction.setBuffer(mSurfaceControl, background);
|
||||
}
|
||||
mTransaction.apply();
|
||||
childSurfaceControl.release();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user