]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliConfig.cxx
Fixing clustering(s) memory leaks
[u/mrichter/AliRoot.git] / STEER / AliConfig.cxx
index 32b77489dbcb04e2f5d17f43199f41f95772f1f9..1239d4f7db44cba5c2a711cdbee7e7e86f442b95 100644 (file)
@@ -118,50 +118,6 @@ AliConfig* AliConfig::Instance ()
     }
    return fgInstance;
 }
-
-//____________________________________________________________________________
-AliConfig::AliConfig():
-  fTopFolder(0x0),
-  fTaskFolder(0x0),
-  fConstFolder(0x0),
-  fDetectorTask(0x0),
-  fDetectorFolder(0x0)
-{
-  //
-  // Default constructor, mainly to keep coding conventions
-  //
-  fgInstance=0;//never mind, its going to exit in next step
-  AliFatal("Constructor should not be called for a singleton");
-}
-//____________________________________________________________________________
-
-AliConfig::AliConfig(const AliConfig& conf):
-  TNamed(conf),
-  fTopFolder(0x0),
-  fTaskFolder(0x0),
-  fConstFolder(0x0),
-  fDetectorTask(0x0),
-  fDetectorFolder(0x0)
-{
-  //
-  // Copy constructor, mainly to keep coding conventions
-  //
-  fgInstance=0;
-    
-  AliFatal("Copy constructor should not be called for a singleton");
-}
-//____________________________________________________________________________
-
-AliConfig& AliConfig::operator=(const AliConfig& /*conf*/)
-{
-  //
-  // Assignment, mainly to keep coding conventions
-  //
-  fgInstance=0;
-    
-  AliFatal("Assignment operator should not be called for a singleton");
-  return *this;
-}
 //____________________________________________________________________________
 
 AliConfig::AliConfig(const char *name, const char *title): 
@@ -443,7 +399,7 @@ void    AliConfig::Add (char *list)
   
   const char   *confPath = gSystem->Getenv ("ALICE_CONFIG_PATH");
   if  (confPath) {
-    path = new char[strlen (confPath)];
+    path = new char[strlen (confPath)+1];
     strcpy (path, confPath);
   } else {
     const char   *alice = gSystem->Getenv ("ALICE_ROOT");
@@ -479,8 +435,8 @@ void    AliConfig::Add (char *list)
       while ((obj = next ()))
         {
           TString dir(obj->GetName());
-          TString path  = dir + "/" + token;
-          TString macro = path + ".C";
+          TString apath  = dir + "/" + token;
+          TString macro = apath + ".C";
           if (!gSystem->AccessPathName (macro.Data())) 
            {
             gInterpreter->ExecuteMacro (macro.Data());                            
@@ -499,12 +455,12 @@ void    AliConfig::Add (char *list)
            } 
           else 
            {
-            TString macroDefault = path + "/Default.C";
+            TString macroDefault = apath + "/Default.C";
             if (!gSystem->AccessPathName (macroDefault.Data()))
               {
                 gInterpreter->ExecuteMacro (macroDefault.Data());
                 found = "(" + macro + ")";
-                TString macroConfigure = path + "/Configure.C";
+                TString macroConfigure = apath + "/Configure.C";
                 if (!gSystem->AccessPathName (macroConfigure.Data()))  
                   {
                     gInterpreter->ExecuteMacro (macroConfigure.Data());