Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.7.3
-
None
-
OS X 10.6 and 10.7, Qt 4.7.3
-
0806c624bb3e29c0ca852def079f21bc56174be6
Description
Run the testcase below. Close the second (child) window, then the other window. The application will crash; see trace after the testcase.
This seems to be related to creating a QGLWidget viewport inside one window (the parent window), and then changing window flags to show it within a different window (the child).
Test case:
#include <QApplication> #include <QGraphicsView> #include <QGLWidget> int main(int argc, char *argv[]) { QApplication a(argc, argv); QWidget *parent = new QWidget; parent->show(); QGraphicsView *v2 = new QGraphicsView(parent); // Does not crash without the parent v2->setViewport(new QGLWidget); // Does not crash if this happens after setWindowFlags v2->setWindowFlags(Qt::Window); v2->setAttribute(Qt::WA_DeleteOnClose); // Does not crash if the window isn't deleted v2->resize(200, 200); v2->show(); return a.exec(); }
Trace:
Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000043430120 Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 QtGui 0x00ed5986 _ZL27qt_post_window_change_eventP7QWidget + 22 1 QtGui 0x00ed62f9 qt_event_request_window_change(QWidget*) + 121 2 QtGui 0x00ee5b98 QWidgetPrivate::hide_sys() + 184 3 QtGui 0x00f9c243 QWidgetPrivate::hide_helper() + 147 4 QtGui 0x00fa64a7 QWidget::setVisible(bool) + 1255 5 QtGui 0x00fa47e0 QWidgetPrivate::close_helper(QWidgetPrivate::CloseMode) + 384 6 QtGui 0x00ef3fe5 -[QCocoaWindowDelegate windowShouldClose:] + 69 7 com.apple.AppKit 0x9879cfbc __-[NSWindow __close]_block_invoke_1 + 143 8 com.apple.AppKit 0x987a5ae4 -[NSWindow __close] + 332 9 com.apple.AppKit 0x987a598c -[NSWindow _close:] + 159 10 com.apple.CoreFoundation 0x93d46901 -[NSObject performSelector:withObject:] + 65 11 com.apple.AppKit 0x98187937 -[NSApplication sendAction:to:from:] + 232 12 com.apple.AppKit 0x98187814 -[NSControl sendAction:to:] + 102 13 com.apple.AppKit 0x98187717 -[NSCell _sendActionFrom:] + 160 14 com.apple.AppKit 0x98186ad2 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2295 15 com.apple.AppKit 0x98209b59 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 501 16 com.apple.AppKit 0x98185513 -[NSControl mouseDown:] + 943 ...