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: else:
RNS.log("Link closed, exiting now") RNS.log("Link closed, exiting now")
RNS.Reticulum.exit_handler()
time.sleep(1.5) time.sleep(1.5)
os._exit(0) os._exit(0)

View File

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