mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-16 21:14:20 +01:00
Fix uncaught exception handler
The default handler was mistakenly retrieved after our custom handler
was set, causing it to reference itself. As a result, this led to
infinite recursion.
Bug introduced by eee3f24739.
This commit is contained in:
@@ -225,8 +225,8 @@ public final class Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void internalMain(String... args) throws Exception {
|
private static void internalMain(String... args) throws Exception {
|
||||||
|
Thread.UncaughtExceptionHandler defaultHandler = Thread.getDefaultUncaughtExceptionHandler();
|
||||||
Thread.setDefaultUncaughtExceptionHandler((t, e) -> {
|
Thread.setDefaultUncaughtExceptionHandler((t, e) -> {
|
||||||
Thread.UncaughtExceptionHandler defaultHandler = Thread.getDefaultUncaughtExceptionHandler();
|
|
||||||
Ln.e("Exception on thread " + t, e);
|
Ln.e("Exception on thread " + t, e);
|
||||||
if (defaultHandler != null) {
|
if (defaultHandler != null) {
|
||||||
defaultHandler.uncaughtException(t, e);
|
defaultHandler.uncaughtException(t, e);
|
||||||
|
|||||||
Reference in New Issue
Block a user