Re: [ROOT] Multiple objects of MyClass in CINT

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Nov 16 2004 - 16:52:36 MET


In your class constructor you create a TCanvas with a fixed name "Something".
When you create the second object and attempt to create a canavs with the same
name than an existing canvas, the previous canvas is automatically deleted. Your
class is not protected for this case.
You can pass an argument to your constructor that could be the canvas name.

Rene brun

margar@atlas.yerphi.am wrote:
> 
> Dear Rene
> 
> in the attachment you can find the shortest version of my class.
> You can reproduce the problem just doing the following
> 
> 
> root [0] .L MyClass.cpp++O
> Info in <TUnixSystem::ACLiC>: creating shared library
> /cern/ROOT/root401/mylib//home/simonyan/ROOT/leakage/classes/MyClass_cpp.so
> root [1]
> root [1] MyClass c1
> root [2] MyClass c2
> root [3] .q
> 
>  *** Break *** segmentation violation
>  Generating stack trace...
>  0x42029188 in <unknown> from /cern/ROOT/root401/bin/root.exe
>  0x41b94875 in <unknown> from
> /cern/ROOT/root401/mylib//home/simonyan/ROOT/leakage/classes/MyClass_cpp.so
> ..............................
> ............................
> 
> 
> Best regards,
>                Margar Simonyan
> 
> On Tue, 16 Nov 2004, Rene Brun wrote:
> 
> > Are you doing something special in your MyClass constructor?
> > Could you provide a simple/short/running script showing the problem?
> >
> > Rene Brun
> >
> > margar@atlas.yerphi.am wrote:
> > >
> > > Dear all
> > >
> > > I have set of classes (MyClass) which I am compiling with ACLIC and
> > > loading shared libs from rootlogon.C, then crating objects of MyClass using CINT
> > > interactively or with macros. Everything is fine when there is only one
> > > object of MyClass at time, while ROOT crashes after second object has been
> > > created. Is there any limitation or there is a way to solve the issue ?
> > >
> > > I am using ROOT 4.01/02 on CERN Linux 7.3 with gcc-3.2
> > >
> > > Thanks,
> > >         Margar Simonyan
> >
> 
>   --------------------------------------------------------------------------------
>                   Name: MyClass.cpp
>    MyClass.cpp    Type: Plain Text (TEXT/PLAIN)
>               Encoding: BASE64
> 
>                 Name: MyClass.h
>    MyClass.h    Type: Plain Text (TEXT/PLAIN)
>             Encoding: BASE64



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:10 MET