Hi!
I have a GLWidget that shows a 3d scene. When I open a file with a scene in, I need to replace that GLwidget with a new GLwidget with the loaded scene. The problem is that the program spits out a lot of exceptions when I close the program. So I suppose that the widget holding the GLWidget still tries to destroy the old GLWidget when I close the program. I'll spare you the long list of messages, but it starts with ***glibc detected*** double free or corruption.
Is there any way to solve this?
This is my attempt to do this:
/*
canvas is the GLWidget holding the 3d scene.
*/
mainLayout->removeWidget ( canvas );
canvas->hide ( );
canvas->setParent ( NULL )
delete canvas;
/*
Creates the new GLCanvas containing the new loaded scene....
*/
canvas = new GLCanvas ( newScene, this );
mainLayout->addWidget ( canvas );
/*
canvas is the GLWidget holding the 3d scene.
*/
mainLayout->removeWidget ( canvas );
canvas->hide ( );
canvas->setParent ( NULL )
delete canvas;
/*
Creates the new GLCanvas containing the new loaded scene....
*/
canvas = new GLCanvas ( newScene, this );
mainLayout->addWidget ( canvas );
To copy to clipboard, switch view to plain text mode
hope I've explained the problem in a understandable way...
thanks for reading
pir
Bookmarks