Sorry I meant to post this under Stat and math tools, could a moderator move it for me?
Hello,
The code below will leak memory, but if I comment the line where writeToStream is called, there is no leak. Does anyone know of a solution to this?
Thanks,
Lenny
RooRealVar *signal = new RooRealVar("signal", "signal", -2, 20);
RooRealVar *mean = new RooRealVar("mean",
"mean",
0,20);
RooRealVar *sigma = new RooRealVar("sigma",
"sigma",
0,20);
stringstream var_cache;
for(Int_t l=0;l<100000000;l++){
cout<<l<<endl;
sigma.setVal(l/50);
RooGaussian *test_fit_model = new RooGaussian("test_fit_model","test_fit_model",*signal,*mean,*sigma);
test_fit_model->getVariables()->writeToStream(var_cache, kFALSE);
delete test_fit_model;
var_cache.str(string());
var_cache.clear();
}