OBJ smooting groups exported enabled for by default for the first smooth group (should have been disabled)
gen_library.c - Own error, hashing did not decref the tuple it created. Draw.c - callback also missed a decref
This commit is contained in:
		| @@ -740,7 +740,7 @@ static void exec_but_callback(void *pyobj, void *data) | ||||
| 	PyObject *result; | ||||
| 	PyObject * pyvalue; | ||||
| 	uiBut *but = (uiBut *)data; | ||||
| 	PyObject *arg = PyTuple_New( 2 ); | ||||
| 	PyObject *arg; | ||||
| 	PyObject *callback = (PyObject *)pyobj; | ||||
| 	 | ||||
| 	double value = ui_get_but_val(but); | ||||
| @@ -795,6 +795,7 @@ static void exec_but_callback(void *pyobj, void *data) | ||||
| 		printf("Error, no button type matched."); | ||||
| 	} | ||||
| 	 | ||||
| 	arg = PyTuple_New( 2 ); | ||||
| 	if (uiblock==NULL) | ||||
| 		PyTuple_SetItem( arg, 0, PyInt_FromLong(but->retval - EXPP_BUTTON_EVENTS_OFFSET) ); | ||||
| 	else | ||||
| @@ -803,6 +804,8 @@ static void exec_but_callback(void *pyobj, void *data) | ||||
| 	PyTuple_SetItem( arg, 1, pyvalue ); | ||||
| 	 | ||||
| 	result = PyObject_CallObject( callback, arg ); | ||||
| 	Py_DECREF(arg); | ||||
| 	 | ||||
| 	if (!result) { | ||||
| 		Py_DECREF(pyvalue); | ||||
| 		PyErr_Print(  ); | ||||
|   | ||||
| @@ -330,9 +330,12 @@ long GenericLib_hash(PyObject * pydata) | ||||
| { | ||||
| 	ID *id = ((BPy_GenericLib *)pydata)->id; | ||||
| 	PyObject *pyhash = PyTuple_New( 2 ); | ||||
| 	long hash; | ||||
| 	PyTuple_SetItem( pyhash, 0, PyString_FromString(id->name) ); | ||||
| 	if (id->lib) PyTuple_SetItem( pyhash, 0, PyString_FromString(id->lib->name) ); | ||||
| 	else		PyTuple_SetItem( pyhash, 1, Py_None ); | ||||
| 	return PyObject_Hash(pyhash); | ||||
| 	if (id->lib) PyTuple_SetItem( pyhash, 1, PyString_FromString(id->lib->name) ); | ||||
| 	else		PyTuple_SetItem( pyhash, 1, EXPP_incr_ret(Py_None) ); | ||||
| 	hash = PyObject_Hash(pyhash); | ||||
| 	Py_DECREF(pyhash); | ||||
| 	return hash; | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user