0

Fix dereferencing bug, hopefully should address mineral-overlay crash

Should fix #633
This commit is contained in:
Andrew Chin
2012-04-07 17:59:46 -04:00
parent f4d43d544a
commit 5aefebecbe

View File

@@ -90,6 +90,7 @@ overlay_mineral_start(void *data, RenderState *state, PyObject *support) {
/* now do custom initializations */ /* now do custom initializations */
self = (RenderPrimitiveMineral *)data; self = (RenderPrimitiveMineral *)data;
// opt is a borrowed reference. do not deref
if (!render_mode_parse_option(support, "minerals", "O", &(opt))) if (!render_mode_parse_option(support, "minerals", "O", &(opt)))
return 1; return 1;
if (opt && opt != Py_None) { if (opt && opt != Py_None) {
@@ -119,7 +120,6 @@ overlay_mineral_start(void *data, RenderState *state, PyObject *support) {
} else { } else {
self->minerals = default_minerals; self->minerals = default_minerals;
} }
Py_XDECREF(opt);
/* setup custom color */ /* setup custom color */
self->parent.get_color = get_color; self->parent.get_color = get_color;