chiark
/
gitweb
/
~ianmdlvl
/
nlopt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9393984
)
fix memory leak in python wrapper on exception
author
stevenj
<stevenj@alum.mit.edu>
Thu, 8 Jul 2010 19:04:36 +0000
(15:04 -0400)
committer
stevenj
<stevenj@alum.mit.edu>
Thu, 8 Jul 2010 19:04:36 +0000
(15:04 -0400)
darcs-hash:
20100708190436
-c8de0-
0b50fd5776481816285a42d5b06679666377d0ea
.gz
swig/nlopt-python.i
patch
|
blob
|
history
diff --git
a/swig/nlopt-python.i
b/swig/nlopt-python.i
index db1967acf79dc74ffde1aa492be7080763202403..83df76f4e4c21563aef48600435b4fd323488650 100644
(file)
--- a/
swig/nlopt-python.i
+++ b/
swig/nlopt-python.i
@@
-138,6
+138,7
@@
static double func_python(unsigned n, const double *x, double *grad, void *f)
double val = HUGE_VAL;
if (PyErr_Occurred()) {
+ Py_XDECREF(result);
throw nlopt::forced_stop(); // just stop, don't call PyErr_Clear()
}
else if (result && PyFloat_Check(result)) {