]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDarrayF.cxx
extend debug stream to prepare studies of bremsstrahlung detection in
[u/mrichter/AliRoot.git] / TRD / AliTRDarrayF.cxx
index 881a4bae8d23ac46455fe3de8bbe90b8ce7abcfb..51883b2f832c0a0fe02d6e3d244dbb909fd60cd6 100644 (file)
@@ -46,10 +46,15 @@ AliTRDarrayF::~AliTRDarrayF()
   // Default destructor
   //
 
+  if (fArray) {
+    delete [] fArray;
+    fArray = 0;
+  }
+
 }
 
 //_____________________________________________________________________________
-void AliTRDarrayF::Copy(TObject &a)
+void AliTRDarrayF::Copy(TObject &a) const
 {
   //
   // Copy function
@@ -70,11 +75,17 @@ void AliTRDarrayF::Expand(Int_t n)
   // The user is responsible for the appropriate size of the array.
   //
 
-  if (n < 0) return;  
-  fArray = (Float_t*) TStorage::ReAlloc(fArray
-                                       ,n  * sizeof(Float_t)
-                                       ,fN * sizeof(Float_t));
-  if (fArray != 0) fN = n;
+  if (n < 0) {
+    return;  
+  }
+
+  fArray = (Float_t *) TStorage::ReAlloc(fArray
+                                        ,n *sizeof(Float_t)
+                                        ,fN*sizeof(Float_t));
+
+  if (fArray != 0) {
+    fN = n;
+  } 
+
 }