summaryrefslogtreecommitdiff
path: root/python/__init__.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2017-08-01 22:55:35 -0400
committerPeter LaFosse <peter@vector35.com>2017-08-01 22:55:35 -0400
commit58f64aa020be1f649cb91eb13b1f69fb034e1ad9 (patch)
tree0a6a4313b3bbe432cef77a314b811d965aae074b /python/__init__.py
parent091e90f70c789e161c354ef47f7babc35997cad3 (diff)
Call shutdown whenever binaryninja is unloaded
Diffstat (limited to 'python/__init__.py')
-rw-r--r--python/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/__init__.py b/python/__init__.py
index b066e863..7f5206ff 100644
--- a/python/__init__.py
+++ b/python/__init__.py
@@ -19,6 +19,7 @@
# IN THE SOFTWARE.
+import atexit
# Binary Ninja components
import _binaryninjacore as core
from .enums import *
@@ -58,6 +59,9 @@ def shutdown():
core.BNShutdown()
+atexit.register(shutdown)
+
+
def get_unique_identifier():
return core.BNGetUniqueIdentifierString()