From ecda1f47ca11e53db9a0d57f7367277c3d237904 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Fri, 9 Jun 2023 14:30:17 -0400 Subject: Prevent exception on close in FunctionList --- python/binaryview.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/binaryview.py b/python/binaryview.py index 1e0dc9b4..586c9f6e 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -1882,7 +1882,8 @@ class FunctionList: raise ValueError("FunctionList.__getitem__ supports argument of type integer or slice") def __del__(self): - core.BNFreeFunctionList(self._funcs, len(self)) + if core is not None: + core.BNFreeFunctionList(self._funcs, len(self)) def __len__(self) -> int: return self._count -- cgit v1.3.1