mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
better fix for crash
This commit is contained in:
parent
e7857739d5
commit
effdbb24af
@ -863,10 +863,17 @@ unpack_object() {
|
||||
// valid constructor, create the class object instead of
|
||||
// just a tuple.
|
||||
object = unpack_class_object(dclass);
|
||||
if (object == (PyObject *)NULL) {
|
||||
cerr << "Unable to construct object of class "
|
||||
<< dclass->get_name() << "\n";
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Fall through (if no constructor)
|
||||
|
||||
// If we don't know what kind of class object it is, or it doesn't
|
||||
// have a constructor, fall through and make a tuple.
|
||||
default:
|
||||
@ -878,7 +885,7 @@ unpack_object() {
|
||||
while (more_nested_fields()) {
|
||||
PyObject *element = unpack_object();
|
||||
PyList_Append(object, element);
|
||||
Py_XDECREF(element);
|
||||
Py_DECREF(element);
|
||||
}
|
||||
pop();
|
||||
|
||||
@ -893,6 +900,7 @@ unpack_object() {
|
||||
break;
|
||||
}
|
||||
|
||||
nassertr(object != (PyObject *)NULL, Py_None);
|
||||
return object;
|
||||
}
|
||||
#endif // HAVE_PYTHON
|
||||
|
Loading…
x
Reference in New Issue
Block a user