From 30e42af2d4ca660b06bce2ada7b1a0d303c73239 Mon Sep 17 00:00:00 2001 From: wuderek Date: Fri, 21 Jun 2024 13:41:15 +0800 Subject: [PATCH] Add missing virtual display release() PR #5008 Signed-off-by: Romain Vimont --- .../src/main/java/com/genymobile/scrcpy/ScreenCapture.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/src/main/java/com/genymobile/scrcpy/ScreenCapture.java b/server/src/main/java/com/genymobile/scrcpy/ScreenCapture.java index 95214188..1d878d78 100644 --- a/server/src/main/java/com/genymobile/scrcpy/ScreenCapture.java +++ b/server/src/main/java/com/genymobile/scrcpy/ScreenCapture.java @@ -68,6 +68,11 @@ public class ScreenCapture extends SurfaceCapture implements Device.RotationList device.setFoldListener(null); if (display != null) { SurfaceControl.destroyDisplay(display); + display = null; + } + if (virtualDisplay != null) { + virtualDisplay.release(); + virtualDisplay = null; } }