Home » U++ Library support » U++ Widgets - General questions or Mixed problems » [SOLVED] OpenGL reference example X11 crash
Re: [BUG] OpenGL reference example X11 crash [message #14413 is a reply to message #14388] |
Mon, 25 February 2008 20:18 |
masu
Messages: 378 Registered: February 2006
|
Senior Member |
|
|
I found the problem.
In X11DHCtrl.cpp in Init() class member UserVisualInfo is allocated on heap by calling custom visual info creation function in GLCtrl (CreateVisual()) that returns a pointer to the structure.
This structure is deleted in Init() (from line 156 on) right after using it, but it has to live until it is needed in GLCtrl::AfterInit() in X11GLCtrl.cpp line 111 by calling DHCtrl::GetVisualInfo().
A fix is delete lines 155 to 160 in X11DHCtrl.cpp:
// Frees VisualInfo
if (UserVisualInfo)
{
XFree( (char *)UserVisualInfo);
UserVisualInfo = 0;
}
and add it to DHCtrl destructor.
Of course, I don't know if that imposes any problems elsewhere.
Matthias
|
|
|
Goto Forum:
Current Time: Thu Apr 18 05:01:59 CEST 2024
Total time taken to generate the page: 0.02683 seconds
|