Added timeout in case the JNI Isolate crashes and adds a dispose method to be kill the JNI Isolate
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user