Strange behaviour while using TF1 and TCanvas::SetFillStyle(

Hi there,

The code below produces a strange output: it calls MRF_Fct() endlessly (whether the code is interpreted or compiled (Root 5.28, CentOS 5))

[code]#include <TF1.h>
#include <TCanvas.h>

Double_t MRF_Fct ( Double_t *x , Double_t *par )
{
printf ("\n\tIn MRF_Fct") ;
return (1.) ;
}

TF1* MRF_TF1 ()
{
printf ("\nMRF_TF1: in… ") ;
TF1 *fct = new TF1 (“fct”,MRF_Fct,0.,1000.,0) ;
printf (“out !”) ;
return (fct) ;
}

void ztest ()
{
TF1 * f_flux_ = MRF_TF1 () ;
TCanvas *canvas = new TCanvas (“canvas”) ;
canvas->SetFillStyle(0) ;
f_flux_->Draw() ;
//canvas->Close() ;
return ;
}
[/code]
It seems to only happen:

Cheers,
Z

PS: A workaround is to close the canvas after plotting.

Why do you think it’s endless? It prints many times, but still, after some iterations (depending on n of steps) loop ends. For example, if I do f_flux_->SetNpx(10), this sequence of printed messages is quite short (10 or more, depending on how many times canvas is updated).