increment Py_None correctly

This commit is contained in:
David Rose 2006-11-07 13:38:17 +00:00
parent c3f0f7d58d
commit 0992109979
2 changed files with 4 additions and 1 deletions

View File

@ -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;
}

View File

@ -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