summaryrefslogtreecommitdiffstats
path: root/matlab/mex
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2014-05-02 09:21:02 +0000
committerwpalenst <Willem.Jan.Palenstijn@cwi.nl>2014-05-02 09:21:02 +0000
commit439a41fecd9714800a653142a14f84061ad53242 (patch)
tree2d0126024667778806c7c986846c823139b98674 /matlab/mex
parent75611ea17869a7f38c9775cf7b46818ae50600b8 (diff)
downloadastra-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/mex')
-rw-r--r--matlab/mex/astra_mex_data3d_c.cpp5
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");