Re: TCanvas behaviour

Rene Brun (Rene.Brun@cern.ch)
Thu, 16 Jan 1997 16:20:48 +0100


OLSZEWSKI@vsk02.ifj.edu.pl wrote:
>
> Observation on SGI, Irix 5.3:
>
> One should only create TCanvas variables with "new" and not declare them
> like: TCanvas can("ala");. In this later case the ROOT can not be reset
> neither by .reset nor by gROOT.Reset() and executing same macro again
> induces "segmentation violation" error.
>
> Trying other classes I do not observe this kind of behaviour. Is this
> an error in ROOT?
>
> Andrzej.O.

You are right. If you look at the ROOT tutorials, we always
create TCanvas via new. This is necessary if you run to run
your macro many times in the same session.
Note that this also applies to TPad and TFile objects.
We still have to explain decently the general question of scoping
on our Web pages.
Thanks for the remark
Rene Brun