mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-08-19 03:27:57 -04:00
Improved interface detach on shared instance shutdown
This commit is contained in:
parent
1b48f43a0d
commit
4f4961257c
6 changed files with 69 additions and 32 deletions
|
@ -161,14 +161,16 @@ class Reticulum:
|
|||
interfacepath = ""
|
||||
|
||||
__instance = None
|
||||
|
||||
|
||||
__interface_detach_ran = False
|
||||
@staticmethod
|
||||
def exit_handler():
|
||||
# This exit handler is called whenever Reticulum is asked to
|
||||
# shut down, and will in turn call exit handlers in other
|
||||
# classes, saving necessary information to disk and carrying
|
||||
# out cleanup operations.
|
||||
|
||||
if not Reticulum.__interface_detach_ran:
|
||||
RNS.Transport.detach_interfaces()
|
||||
RNS.Transport.exit_handler()
|
||||
RNS.Identity.exit_handler()
|
||||
|
||||
|
@ -178,15 +180,15 @@ class Reticulum:
|
|||
@staticmethod
|
||||
def sigint_handler(signal, frame):
|
||||
RNS.Transport.detach_interfaces()
|
||||
Reticulum.__interface_detach_ran = True
|
||||
RNS.exit()
|
||||
|
||||
|
||||
@staticmethod
|
||||
def sigterm_handler(signal, frame):
|
||||
RNS.Transport.detach_interfaces()
|
||||
Reticulum.__interface_detach_ran = True
|
||||
RNS.exit()
|
||||
|
||||
|
||||
@staticmethod
|
||||
def get_instance():
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue