Permalink
Browse files

FIX: ref count decrement of py_callback in tnc

  • Loading branch information...
1 parent fa2ba26 commit 119d528d65d4262c4b63d3e8a1b2f8c206cb69dc @dlax dlax committed Oct 20, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 scipy/optimize/tnc/moduleTNC.c
@@ -302,7 +302,7 @@ PyObject *moduleTNC_minimize(PyObject *self, PyObject *args)
&nfeval, callback_function);
Py_DECREF(py_function);
- Py_XDECREF(py_callback);
+ if (py_callback != Py_None) Py_DECREF(py_callback);
if (low) free(low);
if (up) free(up);

0 comments on commit 119d528

Please sign in to comment.