summaryrefslogtreecommitdiff
path: root/python/databuffer.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/databuffer.py')
-rw-r--r--python/databuffer.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/python/databuffer.py b/python/databuffer.py
index bb6a8ca5..ef8fc483 100644
--- a/python/databuffer.py
+++ b/python/databuffer.py
@@ -35,7 +35,8 @@ class DataBuffer:
self.handle = core.BNCreateDataBuffer(contents, len(contents))
def __del__(self):
- core.BNFreeDataBuffer(self.handle)
+ if core is not None:
+ core.BNFreeDataBuffer(self.handle)
def __len__(self):
return int(core.BNGetDataBufferLength(self.handle))