From 1fa9cd6fd0b76d0654678cecdb6c731b6de0c6b5 Mon Sep 17 00:00:00 2001
From: Rene Brun <Rene.Brun@cern.ch>
Date: Fri, 9 Jan 2004 14:35:36 +0000
Subject: [PATCH] In TFormula::Compile, delete the array of fParams and fnames
 in case the number of parameters is null. Without this fix, derived functions
 like TF12 did not behave correctly when the TF2 object had one or more
 parameters.

git-svn-id: http://root.cern.ch/svn/root/trunk@7877 27541ba8-7e3a-0410-8455-c3a389f83636
---
 hist/src/TFormula.cxx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/hist/src/TFormula.cxx b/hist/src/TFormula.cxx
index 9643c025b5a..bdbaa8c8e4a 100644
--- a/hist/src/TFormula.cxx
+++ b/hist/src/TFormula.cxx
@@ -1,4 +1,4 @@
-// @(#)root/hist:$Name:  $:$Id: TFormula.cxx,v 1.62 2003/12/27 18:49:03 brun Exp $
+// @(#)root/hist:$Name:  $:$Id: TFormula.cxx,v 1.63 2004/01/06 07:44:35 brun Exp $
 // Author: Nicolas Brun   19/08/95
 
 /*************************************************************************
@@ -1861,7 +1861,10 @@ Int_t TFormula::Compile(const char *expression)
         SetParName(2,"Sigma");
      }
   }
-
+  if (fNpar <= 0) {
+     delete [] fParams; fParams=0;
+     delete [] fNames;  fNames = 0;
+  }
 
 //*-* replace 'normal' == or != by ==(string) or !=(string) if needed.
   Int_t is_it_string,last_string=0,before_last_string=0;
-- 
GitLab