diff options
| author | Rusty Wagner <rusty@vector35.com> | 2018-07-30 15:57:39 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2018-07-30 15:57:39 -0400 |
| commit | 78ea5dced49f4576d71c4549001ecdb63a2da53e (patch) | |
| tree | 68ace9fc4e76f3fa221b5e69cba65263f454349b | |
| parent | 6eb3234d924d870641ee30c4263437f1d8a8d5c7 (diff) | |
Don't abort flow graph unless completion routine was set
| -rw-r--r-- | flowgraph.cpp | 3 | ||||
| -rw-r--r-- | python/flowgraph.py | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/flowgraph.cpp b/flowgraph.cpp index c779db0c..81950367 100644 --- a/flowgraph.cpp +++ b/flowgraph.cpp @@ -44,7 +44,8 @@ FlowGraph::~FlowGraph() { // This object is going away, so ensure that any pending completion routines are // no longer called - Abort(); + if (m_completeFunc) + Abort(); BNFreeFlowGraph(m_graph); } diff --git a/python/flowgraph.py b/python/flowgraph.py index cf2d8e02..884d6587 100644 --- a/python/flowgraph.py +++ b/python/flowgraph.py @@ -278,7 +278,8 @@ class FlowGraph(object): self._cb = ctypes.CFUNCTYPE(None, ctypes.c_void_p)(self._complete) def __del__(self): - self.abort() + if self._on_complete is not None: + self.abort() core.BNFreeFlowGraph(self.handle) def __eq__(self, value): |
