From: srit Date: Thu, 24 Mar 2011 16:24:59 +0000 (+0000) Subject: Put mDefaultLUTColor in smart pointer to avoid memory leak X-Git-Tag: v1.2.0~123 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=90b2bcd02606cb901955c074cfe9c13dc48d12f8;p=clitk.git Put mDefaultLUTColor in smart pointer to avoid memory leak --- diff --git a/vv/vvToolStructureSetManager.cxx b/vv/vvToolStructureSetManager.cxx index 8c008ad..20ecad3 100644 --- a/vv/vvToolStructureSetManager.cxx +++ b/vv/vvToolStructureSetManager.cxx @@ -69,7 +69,7 @@ vvToolStructureSetManager::vvToolStructureSetManager(vvMainWindowBase * parent, mIsAllVisibleEnabled = false; mNumberOfVisibleROI = 0; mNumberOfVisibleContourROI = 0; - mDefaultLUTColor = vtkLookupTable::New(); + mDefaultLUTColor = vtkSmartPointer::New(); for(int i=0; iGetNumberOfTableValues(); i++) { double r = (rand()/(RAND_MAX+1.0)); double v = (rand()/(RAND_MAX+1.0)); diff --git a/vv/vvToolStructureSetManager.h b/vv/vvToolStructureSetManager.h index 6ea8808..8060e8f 100644 --- a/vv/vvToolStructureSetManager.h +++ b/vv/vvToolStructureSetManager.h @@ -72,7 +72,7 @@ protected: int mCurrentStructureSetIndex; clitk::DicomRT_ROI * mCurrentROI; vvROIActor * mCurrentROIActor; - vtkLookupTable * mDefaultLUTColor; + vtkSmartPointer mDefaultLUTColor; bool mIsAllVisibleEnabled; int mNumberOfVisibleROI; int mNumberOfVisibleContourROI;