From 58f64aa020be1f649cb91eb13b1f69fb034e1ad9 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Tue, 1 Aug 2017 22:55:35 -0400 Subject: Call shutdown whenever binaryninja is unloaded --- python/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'python') 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() -- cgit v1.3.1