[Scipy-svn] r2896 - trunk/Lib/linsolve/umfpack

scipy-svn@scip... scipy-svn@scip...
Wed Apr 4 03:37:00 CDT 2007


Author: rc
Date: 2007-04-04 03:36:55 -0500 (Wed, 04 Apr 2007)
New Revision: 2896

Modified:
   trunk/Lib/linsolve/umfpack/umfpack.i
Log:
fixed swig/python detected a memory leak of type 'void *'...

Modified: trunk/Lib/linsolve/umfpack/umfpack.i
===================================================================
--- trunk/Lib/linsolve/umfpack/umfpack.i	2007-04-01 03:44:55 UTC (rev 2895)
+++ trunk/Lib/linsolve/umfpack/umfpack.i	2007-04-04 08:36:55 UTC (rev 2896)
@@ -117,6 +117,7 @@
     return NULL; \
   } \
   $1 = (double *) obj->data; \
+  Py_DECREF( obj ); \
 };
 
 /*!
@@ -130,7 +131,7 @@
 }; \
 %typemap( argout ) ttype* opaque_argout { \
   PyObject *obj; \
-  obj = SWIG_NewPointerObj( (ttype) (*$1), $*1_descriptor, 1 ); \
+  obj = SWIG_NewPointerObj( (ttype) (*$1), $*1_descriptor, 0 ); \
   $result = helper_appendToTuple( $result, obj ); \
 };
 
@@ -146,7 +147,7 @@
 }; \
 %typemap( argout ) ttype* opaque_arginout { \
   PyObject *obj; \
-  obj = SWIG_NewPointerObj( (ttype) (*$1), $*1_descriptor, 1 ); \
+  obj = SWIG_NewPointerObj( (ttype) (*$1), $*1_descriptor, 0 ); \
   $result = helper_appendToTuple( $result, obj ); \
 };
 



More information about the Scipy-svn mailing list