From: zampolli Date: Tue, 23 Oct 2007 07:23:53 +0000 (+0000) Subject: Safer distructor - some checks added. X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=7981612de782e9f73d6583861c92d4b0f07ec96e;hp=99b06af5cb2bde1f6ebac2d86a8fbe633548f56d Safer distructor - some checks added. --- diff --git a/TOF/AliTOFPreprocessor.cxx b/TOF/AliTOFPreprocessor.cxx index a6f80d737de..13992f70d17 100644 --- a/TOF/AliTOFPreprocessor.cxx +++ b/TOF/AliTOFPreprocessor.cxx @@ -72,13 +72,19 @@ AliTOFPreprocessor::AliTOFPreprocessor(AliShuttleInterface* shuttle) : AliTOFPreprocessor::~AliTOFPreprocessor() { // destructor - delete fData; - fData = 0; - delete fh2; - fh2 = 0; - fCal->Clear(); - delete fCal; - fCal = 0; + if (fData){ + delete fData; + fData = 0; + } + if (fh2){ + delete fh2; + fh2 = 0; + } + if (fCal){ + fCal->Clear(); + delete fCal; + fCal = 0; + } } //______________________________________________________________________________