Hello<br><br>I need some help to implement a QT Window to draw some OpenGL in an python-GTK2 application.<br>In the GTK application, I have a push button which will launch an OpenGL scenery (In a QT window). I should be able to close the OpenGL Window and to reopen it as many times as I want, without exiting the GTK application.<br>
<br>I used the code found here : <a href="http://www.siafoo.net/snippet/316">http://www.siafoo.net/snippet/316</a> , but rewritten for my app (as I call main() from the GTK part) :<br><br>def main():<br> app = QtGui.QApplication(['Spiral Widget Demo'])<br>
window = SpiralWidgetDemo()<br> window.show()<br> app.exec_()<br><br><br>My code works perfectly under Mac OS X with python 2.7 and the pyQT port from macports. But under Ubuntu 10.10 with python 2.6.6 I get a segmentation fault if I try to reopen the window.<br>
<br>What I do :<br><br>- Open OpenGL Window (QT)<br>- Close it with the X<br>- Reopen it<br>- SegFault here<br><br>Why is there a difference between the OS X and ubuntu packages ? I have a backtrace (made with dgb) of the segfault. It seems that the memory is not cleared when I close the window. I don't want to use sys.exit because it will also close my GTK app.<br>
<br><br>#0 0x0000000000497d72 in ?? ()<br>#1 0x0000000000499642 in PyErr_WarnEx ()<br>#2 0x00007ffff536d274 in ?? ()<br> from /usr/lib/pymodules/python2.6/gtk-2.0/gobject/_gobject.so<br>#3 0x00007ffff5a0bb89 in g_logv () from /lib/libglib-2.0.so.0<br>
#4 0x00007ffff5a0bfa3 in g_log () from /lib/libglib-2.0.so.0<br>#5 0x00007fffe1cde39e in ?? () from /usr/lib/libQtGui.so.4<br>#6 0x00007fffe1cdf06e in ?? () from /usr/lib/libQtGui.so.4<br>#7 0x00007fffe1ce4036 in ?? () from /usr/lib/libQtGui.so.4<br>
#8 0x00007fffe1cc78ee in QGtkStyle::QGtkStyle() () from /usr/lib/libQtGui.so.4<br>#9 0x00007fffe1c4dda3 in QStyleFactory::create(QString const&) ()<br> from /usr/lib/libQtGui.so.4<br>#10 0x00007fffe193cfa7 in QApplication::style() () from /usr/lib/libQtGui.so.4<br>
#11 0x00007fffe1945be5 in QApplicationPrivate::initialize() ()<br> from /usr/lib/libQtGui.so.4<br>#12 0x00007fffe1945d01 in QApplicationPrivate::construct(_XDisplay*, unsigned long, unsigned long) () from /usr/lib/libQtGui.so.4<br>
#13 0x00007fffe1946d91 in QApplication::QApplication(int&, char**, int) ()<br> from /usr/lib/libQtGui.so.4<br>#14 0x00007fffe291f654 in ?? ()<br> from /usr/lib/pymodules/python2.6/PyQt4/QtGui.so<br>#15 0x00007fffe291f73d in ?? ()<br>
from /usr/lib/pymodules/python2.6/PyQt4/QtGui.so<br><br>Thank you in advance if somebody has any explanation why this happens and how to close the window properly and free up memory/threads which are perhaps still open.<br>
<br><br>Michka<br><br><br>