]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Memory leak fixed. All, please be more careful next time while creating objects in...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 26 Jul 2007 14:13:06 +0000 (14:13 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 26 Jul 2007 14:13:06 +0000 (14:13 +0000)
T0/AliT0Parameters.cxx

index 8a7e18da5e40bfc66ee79115a3537bbc85d8526f..a6bd6062ec1165c4342803cb0e833e9f4b679a93 100644 (file)
@@ -270,19 +270,20 @@ Int_t
 AliT0Parameters::GetChannel(Int_t trm,  Int_t tdc, Int_t chain, Int_t channel)
 {
 
-  AliT0LookUpKey * val;  //= new AliT0LookUpKey();
-  AliT0LookUpValue * key= new AliT0LookUpValue(trm,tdc,chain,channel);
-  if (fgLookUp)
-       val = (AliT0LookUpKey*) fgLookUp->GetMapLookup()->GetValue((TObject*)key);
-   else
-     cout<<" !!!!!!!!! no look up table !!!"<<endl;
-  if (!val ) {
-    AliInfo(Form("No such address (%d %d %d %d)!",trm,tdc,chain,channel));
+  if (fgLookUp) {
+    AliT0LookUpValue key(trm,tdc,chain,channel);
+    AliT0LookUpKey *val = (AliT0LookUpKey*) fgLookUp->GetMapLookup()->GetValue((TObject*)&key);
+    if (val )
+      return val->GetKey();
+    else {
+      AliWarning(Form("No such address (%d %d %d %d)!",trm,tdc,chain,channel));
+      return -1;
+    }
+  }
+  else {
+    AliError("No look up table has been loader!");
     return -1;
   }
-  
-  return val->GetKey();
-  
 
 }
 //__________________________________________________________________