diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2014-05-02 09:21:02 +0000 |
---|---|---|
committer | wpalenst <Willem.Jan.Palenstijn@cwi.nl> | 2014-05-02 09:21:02 +0000 |
commit | 439a41fecd9714800a653142a14f84061ad53242 (patch) | |
tree | 2d0126024667778806c7c986846c823139b98674 /matlab | |
parent | 75611ea17869a7f38c9775cf7b46818ae50600b8 (diff) | |
download | astra-439a41fecd9714800a653142a14f84061ad53242.tar.gz astra-439a41fecd9714800a653142a14f84061ad53242.tar.bz2 astra-439a41fecd9714800a653142a14f84061ad53242.tar.xz astra-439a41fecd9714800a653142a14f84061ad53242.zip |
Fix geometry memory leak in astra_mex_data3d create/link
Diffstat (limited to 'matlab')
-rw-r--r-- | matlab/mex/astra_mex_data3d_c.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/matlab/mex/astra_mex_data3d_c.cpp b/matlab/mex/astra_mex_data3d_c.cpp index 8492695..8b6fb95 100644 --- a/matlab/mex/astra_mex_data3d_c.cpp +++ b/matlab/mex/astra_mex_data3d_c.cpp @@ -163,6 +163,7 @@ void astra_mex_data3d_create(int& nlhs, mxArray* plhs[], int& nrhs, const mxArra // Initialize data object pDataObject3D = new CFloat32ProjectionData3DMemory(pGeometry); + delete pGeometry; } else if (sDataType == "-sinocone") { @@ -396,8 +397,7 @@ void astra_mex_data3d_link(int& nlhs, mxArray* plhs[], int& nrhs, const mxArray* // Initialize data object pDataObject3D = new CFloat32VolumeData3DMemory(pGeometry, pHandle); - - //delete pGeometry; // ?? + delete pGeometry; } else if (sDataType == "-sino" || sDataType == "-proj3d" || sDataType == "-sinocone") { @@ -460,6 +460,7 @@ void astra_mex_data3d_link(int& nlhs, mxArray* plhs[], int& nrhs, const mxArray* // Initialize data object pDataObject3D = new CFloat32ProjectionData3DMemory(pGeometry, pHandle); + delete pGeometry; } else { mexErrMsgTxt("Invalid datatype. Please specify '-vol' or '-proj3d'. \n"); |