Home » U++ Library support » U++ Library : Other (not classified elsewhere) » A (maybe) bug in GLControl (on Ubuntu)
A (maybe) bug in GLControl (on Ubuntu) [message #12162] |
Sun, 14 October 2007 22:26 |
mdelfede
Messages: 1307 Registered: September 2007
|
Ultimate Contributor |
|
|
Following the example of making an app with more than one topwindow, i changed the Opengl example in reference like this :
GUI_APP_MAIN
{
MyAppWindow *win, *win2;
win = new MyAppWindow;
win2 = new MyAppWindow;
OpenGLExample gl, gl2;
gl.SetFrame(InsetFrame());
gl2.SetFrame(InsetFrame());
win->Add(gl.HSizePos(10, 10).VSizePos(10, 10));
win2->Add(gl2.HSizePos(10, 10).VSizePos(10, 10));
win->Sizeable().Zoomable();
win2->Sizeable().Zoomable();
win->OpenMain();
win2->OpenMain();
Ctrl::EventLoop();
}
That works, but hangs on window closing. It even hangs the debugger so I've to kill the process.
Investigating a bit more, I've seen that the destructor for GLControl NEVER get called. If I change the code like that :
GUI_APP_MAIN
{
MyAppWindow *win, *win2;
win = new MyAppWindow;
win2 = new MyAppWindow;
OpenGLExample gl, gl2;
gl.SetFrame(InsetFrame());
gl2.SetFrame(InsetFrame());
// win->Add(gl.HSizePos(10, 10).VSizePos(10, 10));
// win2->Add(gl2.HSizePos(10, 10).VSizePos(10, 10));
win->Sizeable().Zoomable();
win2->Sizeable().Zoomable();
win->OpenMain();
win2->OpenMain();
Ctrl::EventLoop();
}
It works (without opengl window on screen, of course) and destructors are called as expected.
It seems that in former code the event loop still runs on closed windows.
I've the feeling that closing the windows don't detach the child OpenGLExample controls inside, but I'm not sure about it.
If OpenGLExample control is not derived from GLControl all goes ok.
Ciao
Max
EDIT : It seems to stay in EventLoop because of
returning 1 even when last top window is closed.
[Updated on: Sun, 14 October 2007 23:49] Report message to a moderator
|
|
|
Re: A (maybe) bug in GLControl (on Ubuntu) [message #12198 is a reply to message #12162] |
Wed, 17 October 2007 19:05 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
mdelfede wrote on Sun, 14 October 2007 16:26 | Following the example of making an app with more than one topwindow, i changed the Opengl example in reference like this :
GUI_APP_MAIN
{
MyAppWindow *win, *win2;
win = new MyAppWindow;
win2 = new MyAppWindow;
OpenGLExample gl, gl2;
gl.SetFrame(InsetFrame());
gl2.SetFrame(InsetFrame());
win->Add(gl.HSizePos(10, 10).VSizePos(10, 10));
win2->Add(gl2.HSizePos(10, 10).VSizePos(10, 10));
win->Sizeable().Zoomable();
win2->Sizeable().Zoomable();
win->OpenMain();
win2->OpenMain();
Ctrl::EventLoop();
}
That works, but hangs on window closing. It even hangs the debugger so I've to kill the process.
Investigating a bit more, I've seen that the destructor for GLControl NEVER get called.
|
Do you "delete" the window somewhere?
Mirek
|
|
|
Re: A (maybe) bug in GLControl (on Ubuntu) [message #12208 is a reply to message #12198] |
Thu, 18 October 2007 12:29 |
mdelfede
Messages: 1307 Registered: September 2007
|
Ultimate Contributor |
|
|
luzr wrote on Wed, 17 October 2007 19:05 |
Do you "delete" the window somewhere?
|
Of course, as in example, in MyAppWindow destructor....
At first I tried also to delete it at the end, but that of course doesn't work because of eventloop still running.
As I said, if the control is NOT derived from GLCtrl, all that works. I think that's something missing on GLCtrl class, but I had no time to investigate it more in depth.
Or, maybe, something missing in core classes when a control is built with a window handler as in GLCtrl.
Ciao
Max
|
|
|
Re: A (maybe) bug in GLControl (on Ubuntu) [message #12209 is a reply to message #12208] |
Thu, 18 October 2007 14:37 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
mdelfede wrote on Thu, 18 October 2007 06:29 |
luzr wrote on Wed, 17 October 2007 19:05 |
Do you "delete" the window somewhere?
|
Of course, as in example, in MyAppWindow destructor....
At first I tried also to delete it at the end, but that of course doesn't work because of eventloop still running.
As I said, if the control is NOT derived from GLCtrl, all that works. I think that's something missing on GLCtrl class, but I had no time to investigate it more in depth.
Or, maybe, something missing in core classes when a control is built with a window handler as in GLCtrl.
Ciao
Max
|
Hm, do you think you could post the complete package (to save the time recreating the testcase....)?
Mirek
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Thu Mar 28 20:35:23 CET 2024
Total time taken to generate the page: 0.01417 seconds
|