From ce270f4615275d7ff65bb38064660b403ab268f2 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 26 Apr 2018 01:31:43 +0200 Subject: [PATCH] Updated exit handler --- Examples/Filetransfer.py | 1 + RNS/Reticulum.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Examples/Filetransfer.py b/Examples/Filetransfer.py index 87d8a8e..7fd12ac 100644 --- a/Examples/Filetransfer.py +++ b/Examples/Filetransfer.py @@ -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) diff --git a/RNS/Reticulum.py b/RNS/Reticulum.py index 0eea757..c7cee7e 100755 --- a/RNS/Reticulum.py +++ b/RNS/Reticulum.py @@ -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: