mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
call jnius.detach on thread stop
This commit is contained in:
parent
5f3b6af2e0
commit
bbe7b277d2
4 changed files with 9 additions and 2 deletions
|
@ -220,6 +220,7 @@ class Daemon(DaemonThread):
|
||||||
self.print_error("shutting down network")
|
self.print_error("shutting down network")
|
||||||
self.network.stop()
|
self.network.stop()
|
||||||
self.network.join()
|
self.network.join()
|
||||||
|
self.on_stop()
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
self.print_error("stopping, removing lockfile")
|
self.print_error("stopping, removing lockfile")
|
||||||
|
|
|
@ -814,7 +814,7 @@ class Network(util.DaemonThread):
|
||||||
self.process_pending_sends()
|
self.process_pending_sends()
|
||||||
|
|
||||||
self.stop_network()
|
self.stop_network()
|
||||||
self.print_error("stopped")
|
self.on_stop()
|
||||||
|
|
||||||
def on_header(self, i, header):
|
def on_header(self, i, header):
|
||||||
height = header.get('block_height')
|
height = header.get('block_height')
|
||||||
|
|
|
@ -169,7 +169,7 @@ class Plugins(DaemonThread):
|
||||||
while self.is_running():
|
while self.is_running():
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
self.run_jobs()
|
self.run_jobs()
|
||||||
self.print_error("stopped")
|
self.on_stop()
|
||||||
|
|
||||||
|
|
||||||
hook_names = set()
|
hook_names = set()
|
||||||
|
|
|
@ -149,6 +149,12 @@ class DaemonThread(threading.Thread, PrintError):
|
||||||
with self.running_lock:
|
with self.running_lock:
|
||||||
self.running = False
|
self.running = False
|
||||||
|
|
||||||
|
def on_stop(self):
|
||||||
|
if 'ANDROID_DATA' in os.environ:
|
||||||
|
import jnius
|
||||||
|
jnius.detach()
|
||||||
|
self.print_error("jnius detach")
|
||||||
|
self.print_error("stopped")
|
||||||
|
|
||||||
|
|
||||||
is_verbose = False
|
is_verbose = False
|
||||||
|
|
Loading…
Add table
Reference in a new issue