Problem with TGeoManager

Hello,
I have a problem with a simple geometry I have created for a detector. The fact is root crash when I try to delete the TGeoManager object or I try re-create it. Due to I have this geometry integrated in a Qt Application my program crash every time I try to load a new event.
The same problem can be seen if you run the little program which I attach in this post. It crash when you run the program the second time or simply do geom->Delete().
I have compared this piece of code with one which works (rootgeom.c) I can’t see any important difference. What is happening here?

Thanks for the help.

Alberto
rootgeom.c (5.24 KB)
50lgeom.c (3.31 KB)

Fixed in CVS.
Thanks for reporting this problem.
Regards,

[quote=“delaossa”]Hello,
I have a problem with a simple geometry I have created for a detector. The fact is root crash when I try to delete the TGeoManager object or I try re-create it. Due to I have this geometry integrated in a Qt Application my program crash every time I try to load a new event.
The same problem can be seen if you run the little program which I attach in this post. It crash when you run the program the second time or simply do geom->Delete().
I have compared this piece of code with one which works (rootgeom.c) I can’t see any important difference. What is happening here?

Thanks for the help.

Alberto[/quote]

Check the code of he exampe “ROOT Geomatry browser” from
root.bnl.gov/QtRoot/QtRoot.html#designer

It provides the “reload” button.
Youj may have relaixed it does delet Geome NAger each time the user wants to load the new geometry.

Look up the method, each time the user selects the new file from the File dailog or clicks the “reload geometry” button it does

[code]void GeomBrowser::fileOpenMacro( const QString &fileName )

. . .
if (fGeoManager2Delete) {
delete fGeoManager2Delete;fGeoManager2Delete = 0;
gGeoManager = 0;
}[/code]

See:

[code]grep -n fGeoManager2Delete GeomBrowser.ui.h

234: fGeoManager2Delete = (TGeoManager*)obj;
335: fGeoManager2Delete = 0;
690: if (fGeoManager2Delete) {
691: delete fGeoManager2Delete;fGeoManager2Delete = 0;
727: if (fGeoManager2Delete) {
728: delete fGeoManager2Delete;fGeoManager2Delete = 0;
776: if (fGeoManager2Delete) {
777: delete fGeoManager2Delete;fGeoManager2Delete = 0;[/code]

It does not crash.