Updated exit handler

This commit is contained in:
Mark Qvist 2018-04-26 01:31:43 +02:00
parent 712273dd14
commit ce270f4615
2 changed files with 7 additions and 2 deletions

View File

@ -402,6 +402,7 @@ def link_closed(link):
else:
RNS.log("Link closed, exiting now")
RNS.Reticulum.exit_handler()
time.sleep(1.5)
os._exit(0)

View File

@ -26,6 +26,11 @@ class Reticulum:
storagepath = ""
cachepath = ""
@staticmethod
def exit_handler():
RNS.Transport.exitHandler()
RNS.Identity.exitHandler()
def __init__(self,configdir=None):
if configdir != None:
Reticulum.configdir = configdir
@ -59,8 +64,7 @@ class Reticulum:
RNS.Transport.start()
atexit.register(RNS.Transport.exitHandler)
atexit.register(RNS.Identity.exitHandler)
atexit.register(Reticulum.exit_handler)
def applyConfig(self):
if "logging" in self.config: