mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
prevent crash when packing too much
This commit is contained in:
parent
4dd46f7ca1
commit
764d561740
@ -705,14 +705,17 @@ pack_object(PyObject *object) {
|
||||
bool is_instance = false;
|
||||
|
||||
const DCClass *dclass = NULL;
|
||||
const DCClassParameter *class_param = get_current_field()->as_class_parameter();
|
||||
if (class_param != (DCClassParameter *)NULL) {
|
||||
dclass = class_param->get_class();
|
||||
const DCPackerInterface *current_field = get_current_field();
|
||||
if (current_field != (DCPackerInterface *)NULL) {
|
||||
const DCClassParameter *class_param = get_current_field()->as_class_parameter();
|
||||
if (class_param != (DCClassParameter *)NULL) {
|
||||
dclass = class_param->get_class();
|
||||
|
||||
if (dclass->has_class_def()) {
|
||||
PyObject *class_def = dclass->get_class_def();
|
||||
is_instance = (PyObject_IsInstance(object, dclass->get_class_def()) != 0);
|
||||
Py_DECREF(class_def);
|
||||
if (dclass->has_class_def()) {
|
||||
PyObject *class_def = dclass->get_class_def();
|
||||
is_instance = (PyObject_IsInstance(object, dclass->get_class_def()) != 0);
|
||||
Py_DECREF(class_def);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user