]> Creatis software - clitk.git/commitdiff
Put mDefaultLUTColor in smart pointer to avoid memory leak
authorsrit <srit>
Thu, 24 Mar 2011 16:24:59 +0000 (16:24 +0000)
committersrit <srit>
Thu, 24 Mar 2011 16:24:59 +0000 (16:24 +0000)
vv/vvToolStructureSetManager.cxx
vv/vvToolStructureSetManager.h

index 8c008adc18803f3faacefad4a9b8dff9ad8a6c89..20ecad31385b077ea8bfc353e365d415c854d428 100644 (file)
@@ -69,7 +69,7 @@ vvToolStructureSetManager::vvToolStructureSetManager(vvMainWindowBase * parent,
   mIsAllVisibleEnabled = false;
   mNumberOfVisibleROI = 0;
   mNumberOfVisibleContourROI = 0;
-  mDefaultLUTColor = vtkLookupTable::New();
+  mDefaultLUTColor = vtkSmartPointer<vtkLookupTable>::New();
   for(int i=0; i<mDefaultLUTColor->GetNumberOfTableValues(); i++) {
     double r = (rand()/(RAND_MAX+1.0));
     double v = (rand()/(RAND_MAX+1.0));
index 6ea88085905c8c7e947c2520bbaee140964de05a..8060e8ff8f3286382411061d861bd7906377dfa4 100644 (file)
@@ -72,7 +72,7 @@ protected:
   int mCurrentStructureSetIndex;
   clitk::DicomRT_ROI * mCurrentROI;
   vvROIActor * mCurrentROIActor;
-  vtkLookupTable * mDefaultLUTColor;
+  vtkSmartPointer<vtkLookupTable> mDefaultLUTColor;
   bool mIsAllVisibleEnabled;
   int mNumberOfVisibleROI;
   int mNumberOfVisibleContourROI;