Add missing virtual display release()

PR #5008 <https://github.com/Genymobile/scrcpy/pull/5008>

Signed-off-by: Romain Vimont <rom@rom1v.com>
This commit is contained in:
wuderek 2024-06-21 13:41:15 +08:00 committed by Romain Vimont
parent 9030bd8be4
commit 30e42af2d4
1 changed files with 5 additions and 0 deletions

View File

@ -68,6 +68,11 @@ public class ScreenCapture extends SurfaceCapture implements Device.RotationList
device.setFoldListener(null); device.setFoldListener(null);
if (display != null) { if (display != null) {
SurfaceControl.destroyDisplay(display); SurfaceControl.destroyDisplay(display);
display = null;
}
if (virtualDisplay != null) {
virtualDisplay.release();
virtualDisplay = null;
} }
} }