crash in destructor fixed
authorsgorbuno <sgorbuno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 29 Jun 2011 13:07:02 +0000 (13:07 +0000)
committersgorbuno <sgorbuno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 29 Jun 2011 13:07:02 +0000 (13:07 +0000)
HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFConsistencyControlComponent.cxx

index 9746f3f..fc4a1ce 100644 (file)
@@ -65,13 +65,6 @@ AliHLTTPCHWCFConsistencyControlComponent::AliHLTTPCHWCFConsistencyControlCompone
   // refer to README to build package
   // or
   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-
-  fHistHeaderAll = new TH1F("hHWCFHeaderAll", "fHistHeaderAll",6,0.,6.);
-  fHistHeaderGood = new TH1F("hHWCFHeaderGood", "fHistHeaderGood",6,0.,6.);
-  fHistClusterAll = new TH1F("hHWCFClusterAll", "fHistClusterAll",7,0.,7.);
-  fHistClusterGood = new TH1F("hHWCFClusterGood", "fHistClusterGood",7,0.,7.);
-  fProfHeader = new TH1F("pHWCFHeader", "HWCF: Consistency of header data", 6, 0., 6.);
-  fProfCluster = new TH1F("pHWCFClusters", "HWCF: Consisteny of cluster data", 7, 0., 7.);
 }
 
 
@@ -100,13 +93,7 @@ AliHLTTPCHWCFConsistencyControlComponent& AliHLTTPCHWCFConsistencyControlCompone
 AliHLTTPCHWCFConsistencyControlComponent::~AliHLTTPCHWCFConsistencyControlComponent()
 {
   // see header file for class documentation
-
-  delete fHistHeaderAll;
-  delete fHistHeaderGood;
-  delete fHistClusterAll;
-  delete fHistClusterGood;
-  delete fProfHeader;
-  delete fProfCluster;
+  DoDeinit();
 }
 
 // Public functions to implement AliHLTComponent's interface.
@@ -162,6 +149,13 @@ int AliHLTTPCHWCFConsistencyControlComponent::DoInit( int argc, const char** arg
 {
   // see header file for class documentation
 
+  fHistHeaderAll = new TH1F("hHWCFHeaderAll", "fHistHeaderAll",6,0.,6.);
+  fHistHeaderGood = new TH1F("hHWCFHeaderGood", "fHistHeaderGood",6,0.,6.);
+  fHistClusterAll = new TH1F("hHWCFClusterAll", "fHistClusterAll",7,0.,7.);
+  fHistClusterGood = new TH1F("hHWCFClusterGood", "fHistClusterGood",7,0.,7.);
+  fProfHeader = new TH1F("pHWCFHeader", "HWCF: Consistency of header data", 6, 0., 6.);
+  fProfCluster = new TH1F("pHWCFClusters", "HWCF: Consisteny of cluster data", 7, 0., 7.);
+
   TString arguments = "";
   for ( int i = 0; i < argc; i++ ) {
     if ( !arguments.IsNull() ) arguments += " ";
@@ -313,6 +307,19 @@ int AliHLTTPCHWCFConsistencyControlComponent::Configure( const char* cdbEntry, c
 int AliHLTTPCHWCFConsistencyControlComponent::DoDeinit()
 {
   // see header file for class documentation 
+  if( fHistHeaderAll ) delete fHistHeaderAll;
+  if( fHistHeaderGood ) delete fHistHeaderGood;
+  if( fHistClusterAll ) delete fHistClusterAll;
+  if( fHistClusterGood ) delete fHistClusterGood;
+  if( fProfHeader ) delete fProfHeader;
+  if( fProfCluster ) delete fProfCluster;
+
+  fHistHeaderAll = 0;
+  fHistHeaderGood = 0;
+  fHistClusterAll = 0;
+  fHistClusterGood = 0;
+  fProfHeader = 0;
+  fProfCluster = 0;
   return 0;
 }