]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDdataArrayF.cxx
Correction to find clusters in high detector occupancy (central Hijing) is introduced.
[u/mrichter/AliRoot.git] / TRD / AliTRDdataArrayF.cxx
index 7e4ed79e7f7c2a891aaec10a4e7ee902304b732f..dad99146e0d1749800f8ef50de76c3efe0318b6e 100644 (file)
@@ -76,7 +76,10 @@ AliTRDdataArrayF::~AliTRDdataArrayF()
   // Destructor
   //
 
-  if (fElements) delete fElements;
+  if (fElements) {
+    delete fElements;
+    fElements = 0;
+  }
   
 }
 
@@ -89,9 +92,14 @@ void AliTRDdataArrayF::Allocate(Int_t nrow, Int_t ncol, Int_t ntime)
   // The row- and column dimensions are compressible.
   //
 
-  if (fNelems < 0) AliTRDdataArray::Allocate(nrow,ncol,ntime);
+  if (fNelems < 0) {
+    AliTRDdataArray::Allocate(nrow,ncol,ntime);
+  }
+
+  if (fElements) {
+    delete fElements;
+  }
 
-  if (fElements) delete fElements;
   fElements = new AliTRDarrayF();
   fElements->Set(fNelems);
 
@@ -119,7 +127,10 @@ void AliTRDdataArrayF::Reset()
   // Reset the array (old content gets deleted)
   //
   
-  if (fElements) delete fElements;
+  if (fElements) {
+    delete fElements;
+  }
+
   fElements = new AliTRDarrayF();
   fElements->Set(0); 
 
@@ -506,7 +517,7 @@ Bool_t AliTRDdataArrayF::Next0()
   Int_t i;
   for (i = fCurrentIndex + 1; 
        ((i < fNelems) && (fElements->At(i) <= fThreshold)); 
-       i++);
+       i++) {}
   if (i >= fNelems)  {
     fCurrentIndex = -1;
     return kFALSE;