Fix Coverity
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 5 Dec 2011 16:16:16 +0000 (16:16 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 5 Dec 2011 16:16:16 +0000 (16:16 +0000)
TTherminator/TTherminator.cxx
TTherminator/TTherminator.h

index 6fb0d96..59255c0 100644 (file)
@@ -59,11 +59,23 @@ TTherminator::TTherminator(const TTherminator & therm) :
   TGenerator(therm),
   fCalka(0),
   fEvent(0),
-  fPartDB(0)
+  fPartDB(new ParticleDB())
 {
   // Copy constructor
-  fPartDB = new ParticleDB();
+  //  fPartDB = new ParticleDB();
 }
+TTherminator& TTherminator::operator=(const TTherminator & therm)
+{
+  if (this != &therm) {
+    fCalka = therm.fCalka;
+    fEvent = therm.fEvent;
+    delete fPartDB;
+    fPartDB = new ParticleDB();
+  }
+
+  return *this;
+}
+
 TTherminator::~TTherminator()
 {
   // Destructor
index 6701a5b..e944a69 100644 (file)
@@ -45,6 +45,7 @@ class TTherminator: public TGenerator {
  public:
   TTherminator();
   TTherminator(const TTherminator & therm);
+  TTherminator& operator=(const TTherminator & therm);
   virtual ~TTherminator();
   
   virtual void        ReadParameters();