diff options
| author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2017-11-28 14:16:14 +0100 | 
|---|---|---|
| committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2017-11-28 14:16:22 +0100 | 
| commit | 649b297f9cd1ee2a70a3d01e098c07b916332a93 (patch) | |
| tree | b3dbec2e1df1b3c3cea8680a1f44bbe909d2f0fb | |
| parent | 231a6de483e94507de34bd2f79317d875bbb354b (diff) | |
| download | astra-649b297f9cd1ee2a70a3d01e098c07b916332a93.tar.gz astra-649b297f9cd1ee2a70a3d01e098c07b916332a93.tar.bz2 astra-649b297f9cd1ee2a70a3d01e098c07b916332a93.tar.xz astra-649b297f9cd1ee2a70a3d01e098c07b916332a93.zip | |
Fix memory leak in SART
| -rw-r--r-- | src/SartAlgorithm.cpp | 21 | 
1 files changed, 17 insertions, 4 deletions
| diff --git a/src/SartAlgorithm.cpp b/src/SartAlgorithm.cpp index 5c8f59b..6d39107 100644 --- a/src/SartAlgorithm.cpp +++ b/src/SartAlgorithm.cpp @@ -46,6 +46,10 @@ void CSartAlgorithm::_clear()  {  	CReconstructionAlgorithm2D::_clear();  	m_piProjectionOrder = NULL; +	m_piProjectionOrder = NULL; +	m_pTotalRayLength = NULL; +	m_pTotalPixelWeight = NULL; +  	m_iProjectionCount = 0;  	m_iCurrentProjection = 0;  	m_bIsInitialized = false; @@ -57,10 +61,19 @@ void CSartAlgorithm::_clear()  void CSartAlgorithm::clear()  {  	CReconstructionAlgorithm2D::clear(); -	if (m_piProjectionOrder) { -		delete[] m_piProjectionOrder; -		m_piProjectionOrder = NULL; -	} + +	delete[] m_piProjectionOrder; +	m_piProjectionOrder = NULL; + +	delete m_pTotalRayLength; +	m_pTotalRayLength = NULL; + +	delete m_pTotalPixelWeight; +	m_pTotalPixelWeight = NULL; + +	delete m_pDiffSinogram; +	m_pDiffSinogram = NULL; +  	m_iProjectionCount = 0;  	m_iCurrentProjection = 0;  	m_bIsInitialized = false; | 
