Fix Coverity
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 23 Jan 2012 14:11:24 +0000 (14:11 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 23 Jan 2012 14:11:24 +0000 (14:11 +0000)
TTherminator/TTherminator.cxx

index fec393e..d034ddf 100644 (file)
@@ -56,13 +56,19 @@ TTherminator::TTherminator():
   fPartDB = new ParticleDB();
 }
 TTherminator::TTherminator(const TTherminator & therm) :
-  TGenerator(therm),
-  fCalka(new Integrator(*therm.fCalka)),
-  fEvent(new Event(*therm.fEvent)),
-  fPartDB(new ParticleDB())
+  TGenerator(therm), 
+  fCalka(0),
+  fEvent(0),
+  fPartDB(0)
 {
   // Copy constructor
   //  fPartDB = new ParticleDB();
+  if (fCalka) delete fCalka;
+  fCalka = new Integrator(*therm.fCalka);
+  if (fEvent) delete fEvent;
+  fEvent = new Event(*therm.fEvent);
+  if (fPartDB) delete fPartDB;
+  fPartDB = new ParticleDB();
 }
 TTherminator& TTherminator::operator=(const TTherminator & therm)
 {