Added timeout in case the JNI Isolate crashes and adds a dispose method to be kill the JNI Isolate

This commit is contained in:
2025-10-21 02:18:16 +01:00
parent 0bbf59fda0
commit 2b0b59aad2
2 changed files with 8 additions and 1 deletions

View File

@@ -281,7 +281,10 @@ class AniyomiBridge {
final completer = Completer<T>();
_pendingRequests[message.id] = completer;
_jniSenderPort.send(message);
return completer.future;
return completer.future.timeout(
const Duration(seconds: 20),
onTimeout: () => throw TimeoutException("JNI Isolate timed out")
);
}
String _getDylibDir(Directory supportDirectory) {