Making sure objects are deleted
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 May 2011 14:44:33 +0000 (14:44 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 May 2011 14:44:33 +0000 (14:44 +0000)
TOF/AliTOFClusterFinder.cxx

index 6c0ffcd..8de8eb7 100644 (file)
@@ -263,8 +263,10 @@ AliTOFClusterFinder::~AliTOFClusterFinder()
 
   //if (fTofClusters || fNumberOfTofClusters) {
   if (fNumberOfTofClusters) {
-    for (Int_t ii=0; ii<fNumberOfTofClusters; ii++)
+    for (Int_t ii=0; ii<kTofMaxCluster; ii++) {
       if (fTofClusters[ii]) fTofClusters[ii]->Delete();
+      delete fTofClusters[ii];
+    }
     fNumberOfTofClusters=0;
    }