Correct memory leak in ExtractCE (double deletion of pressure sensors)
authorhaavard <haavard@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 19 Nov 2009 18:49:20 +0000 (18:49 +0000)
committerhaavard <haavard@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 19 Nov 2009 18:49:20 +0000 (18:49 +0000)
TPC/AliTPCPreprocessor.cxx

index 13a5e1c..8e8df56 100644 (file)
@@ -950,12 +950,13 @@ UInt_t AliTPCPreprocessor::ExtractCE(Int_t sourceFXS)
 // Pressure maps
 
  if (fPressure) {
-   AliDCSSensor *sensor=0;
+   AliDCSSensor *sensor=0, *sensorCopy=0;
    for (Int_t isensor=0; isensor<kNumPressureSensors; ++isensor ) {
       sensor = fPressure->GetSensor(kPressureSensorNames[isensor]);
       if (sensor) {
-       sensor->SetNameTitle(kPressureSensorNames[isensor],kPressureSensorNames[isensor]);       
-       ceObjects->Add(sensor);
+       sensorCopy = new AliDCSSensor(*sensor);
+       sensorCopy->SetNameTitle(kPressureSensorNames[isensor],kPressureSensorNames[isensor]);       
+       ceObjects->Add(sensorCopy);
       }
    }
  }