From 1b4891a7ff25d3a61b1c1993fb7ba8a44680f77c Mon Sep 17 00:00:00 2001 From: shahoian Date: Sat, 19 Apr 2014 17:19:29 +0200 Subject: [PATCH] added protection against adding new fPID array in bwd-compatibity rule of AODLinkDef if the array was already created --- STEER/AOD/AliAODTrack.cxx | 2 +- STEER/AODLinkDef.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/STEER/AOD/AliAODTrack.cxx b/STEER/AOD/AliAODTrack.cxx index 81771a17899..1d4985d6839 100644 --- a/STEER/AOD/AliAODTrack.cxx +++ b/STEER/AOD/AliAODTrack.cxx @@ -218,7 +218,7 @@ AliAODTrack::~AliAODTrack() delete fCovMatrix; delete fDetPid; delete fDetectorPID; - delete[] fPID; + if (fPID) {delete[] fPID; fPID = 0;} } diff --git a/STEER/AODLinkDef.h b/STEER/AODLinkDef.h index 30842944fb1..e3362599159 100644 --- a/STEER/AODLinkDef.h +++ b/STEER/AODLinkDef.h @@ -31,7 +31,7 @@ #pragma read sourceClass="AliAODTrack" targetClass="AliAODTrack" source="Double32_t fPID[10]" version="[-22]" \ target="fPID" targetType="Double32_t*" \ - code="{fPID = new Double32_t[10];for(Int_t isp=10;isp--;) fPID[isp]=onfile.fPID[isp];}" + code="{if (!fPID) fPID = new Double32_t[10];for(Int_t isp=10;isp--;) fPID[isp]=onfile.fPID[isp];}" #pragma link C++ class AliAODTrack+; -- 2.43.0