From: <kin...@us...> - 2013-09-03 17:52:08
|
Revision: 6096 http://sourceforge.net/p/teem/code/6096 Author: kindlmann Date: 2013-09-03 17:52:05 +0000 (Tue, 03 Sep 2013) Log Message: ----------- fixing memory leak in nrrd's use of FFTW Modified Paths: -------------- teem/trunk/src/nrrd/fftNrrd.c Modified: teem/trunk/src/nrrd/fftNrrd.c =================================================================== --- teem/trunk/src/nrrd/fftNrrd.c 2013-09-03 17:15:33 UTC (rev 6095) +++ teem/trunk/src/nrrd/fftNrrd.c 2013-09-03 17:52:05 UTC (rev 6096) @@ -51,6 +51,14 @@ return NULL; } +static void * +_nrrdFftwDestroyPlanWrapper(void *ptr) { + fftw_plan plan; + plan = AIR_CAST(fftw_plan, ptr); + fftw_destroy_plan(plan); + return NULL; +} + static void _nrrdDimsReverse(fftw_iodim *dims, unsigned int len) { fftw_iodim buff[NRRD_DIM_MAX]; @@ -227,6 +235,7 @@ biffAddf(NRRD, "%s: unable to create plan", me); airMopError(mop); return 1; } + airMopAdd(mop, plan, _nrrdFftwDestroyPlanWrapper, airMopAlways); /* only after planning is done (which can over-write contents of inData) do we copy the real input values over */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |