mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 03:15:07 -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::
|
PyObject *DCClass::
|
||||||
get_class_def() const {
|
get_class_def() const {
|
||||||
if (_class_def == NULL) {
|
if (_class_def == NULL) {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
return Py_None;
|
return Py_None;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -474,6 +475,7 @@ set_owner_class_def(PyObject *owner_class_def) {
|
|||||||
PyObject *DCClass::
|
PyObject *DCClass::
|
||||||
get_owner_class_def() const {
|
get_owner_class_def() const {
|
||||||
if (_owner_class_def == NULL) {
|
if (_owner_class_def == NULL) {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
return Py_None;
|
return Py_None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -802,6 +802,7 @@ unpack_object() {
|
|||||||
switch (pack_type) {
|
switch (pack_type) {
|
||||||
case PT_invalid:
|
case PT_invalid:
|
||||||
object = Py_None;
|
object = Py_None;
|
||||||
|
Py_INCREF(object);
|
||||||
unpack_skip();
|
unpack_skip();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -900,7 +901,7 @@ unpack_object() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
nassertr(object != (PyObject *)NULL, Py_None);
|
nassertr(object != (PyObject *)NULL, NULL);
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
#endif // HAVE_PYTHON
|
#endif // HAVE_PYTHON
|
||||||
|
Loading…
x
Reference in New Issue
Block a user