mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
increment Py_None correctly
This commit is contained in:
parent
c3f0f7d58d
commit
0992109979
@ -426,6 +426,7 @@ set_class_def(PyObject *class_def) {
|
||||
PyObject *DCClass::
|
||||
get_class_def() const {
|
||||
if (_class_def == NULL) {
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
@ -474,6 +475,7 @@ set_owner_class_def(PyObject *owner_class_def) {
|
||||
PyObject *DCClass::
|
||||
get_owner_class_def() const {
|
||||
if (_owner_class_def == NULL) {
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
|
@ -802,6 +802,7 @@ unpack_object() {
|
||||
switch (pack_type) {
|
||||
case PT_invalid:
|
||||
object = Py_None;
|
||||
Py_INCREF(object);
|
||||
unpack_skip();
|
||||
break;
|
||||
|
||||
@ -900,7 +901,7 @@ unpack_object() {
|
||||
break;
|
||||
}
|
||||
|
||||
nassertr(object != (PyObject *)NULL, Py_None);
|
||||
nassertr(object != (PyObject *)NULL, NULL);
|
||||
return object;
|
||||
}
|
||||
#endif // HAVE_PYTHON
|
||||
|
Loading…
x
Reference in New Issue
Block a user