Skip to content

Display and control your Android device

Fix OpenGL runner shutdown deadlock

Romain Vimont5284b1ecb7f1
diff --git a/server/src/main/java/com/genymobile/scrcpy/Server.java b/server/src/main/java/com/genymobile/scrcpy/Server.java
index e3f1680d..f3e87e87 100644
--- a/server/src/main/java/com/genymobile/scrcpy/Server.java
+++ b/server/src/main/java/com/genymobile/scrcpy/Server.java
@@ -175,8 +175,6 @@ public final class Server {
asyncProcessor.stop();
}
- OpenGLRunner.quit(); // quit the OpenGL thread, if any
-
connection.shutdown();
try {
@@ -186,6 +184,8 @@ public final class Server {
for (AsyncProcessor asyncProcessor : asyncProcessors) {
asyncProcessor.join();
}
+
+ OpenGLRunner.quit(); // quit the OpenGL thread, if any
OpenGLRunner.join();
} catch (InterruptedException e) {
// ignore