Skip to content

Commit f1e37e7

Browse files
committed
Fix an error in debug mode
1 parent 350e90e commit f1e37e7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build
22
tags
33
.DS_Store
4+
.ycm_extra_conf.py
45

BehaviorTree/include/node.h

+9
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ class Node {
5050
delete[] children_;
5151
children_ = NULL;
5252
size_ = 0;
53+
54+
#ifdef Py_DEBUG
55+
// The process terminates and the destruction is called by static variable's destructor(~NodeManager()).
56+
// The Python interpreter is finalized at the moment.
57+
if (!Py_IsInitialized()) {
58+
return;
59+
}
60+
#endif
61+
5362
Py_XDECREF(function_);
5463
function_ = NULL;
5564
}

0 commit comments

Comments
 (0)