Closing QMainWindow crashes on lion 10.7 preview 4.



  • Application is created on mac using Qt 4.7 cocoa , which runs on Leopard and Snow leopard. But crashes on Lion previews.

    Steps to reproduce the crash on lion previews:

    After clicking on button of main window(QMainWindow) of application, another (second non modal) QMainWindow is launched.

    1. When this second QMainWindow is closed by close (x) button [present on upper left side of window] , application crashes.
    2. When this second QMainWindow is closed by "Exit" button("Exit" button is present in toolbar of second QMainWindow), application doesn't crash.

    Also, the call which gets executed by performing either of these two ways (by using close button or exit button of toolbar) is same.

    Below is the crash report:

    Performing @selector(_close:) from sender _NSThemeCloseWidget 0xbc8bc70
    objc[13858]: garbage collection is OFF

    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0 QtGui 0x0263d7d2 -[QCocoaWindow canBecomeKeyWindow] + 34
    1 com.apple.AppKit 0x990f3d1c -[NSApplication(NSWindowCache) _invalidateWindowListForCycleIfNeededForWindow:] + 104
    2 com.apple.AppKit 0x990f3f3d -[NSApplication(NSWindowCache) _setVisibleInCache:forWindow:] + 215
    3 com.apple.AppKit 0x990f19b5 -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 3547
    4 com.apple.AppKit 0x990f0bd5 -[NSWindow _doOrderWindowWithoutAnimation:relativeTo:findKey:forCounter:force:isModal:] + 79
    5 com.apple.AppKit 0x990f0ac8 -[NSWindow _doOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 997
    6 com.apple.AppKit 0x990f0671 -[NSWindow orderWindow:relativeTo:] + 126
    7 com.apple.AppKit 0x9917b4ac -[NSWindow orderOut:] + 49
    8 com.apple.AppKit 0x9927ced9 __-[NSWindow _close]_block_invoke_1 + 527
    9 com.apple.AppKit 0x9927ccb2 -[NSWindow _close] + 354
    10 com.apple.AppKit 0x9927cb48 -[NSWindow close] + 33
    11 com.apple.AppKit 0x9970f594 __-[NSWindow __close]_block_invoke_1 + 167
    12 com.apple.AppKit 0x99718069 -[NSWindow __close] + 332
    13 com.apple.AppKit 0x99717f11 -[NSWindow _close:] + 159
    14 com.apple.CoreFoundation 0x9bf94c31 -[NSObject performSelector:withObject:] + 65
    15 com.apple.AppKit 0x990fb051 -[NSApplication sendAction:to:from:] + 232
    16 com.apple.AppKit 0x990faf2c -[NSControl sendAction:to:] + 102
    17 com.apple.AppKit 0x990fae2f -[NSCell _sendActionFrom:] + 160
    18 com.apple.AppKit 0x990fa1ea -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2295
    19 com.apple.AppKit 0x9917d14d -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 501
    20 com.apple.AppKit 0x990f8c2b -[NSControl mouseDown:] + 943
    21 com.apple.AppKit 0x996a9962 -[_NSThemeWidget mouseDown:] + 303
    22 com.apple.AppKit 0x990c1e96 -[NSWindow sendEvent:] + 7514
    23 QtGui 0x0263dd98 -[QCocoaWindow sendEvent:] + 376
    24 com.apple.AppKit 0x9905a191 -[NSApplication sendEvent:] + 4260
    25 QtGui 0x0264130a -[QNSApplication sendEvent:] + 90
    26 com.apple.AppKit 0x98fec2e4 -[NSApplication run] + 993
    27 QtGui 0x0264b951 QEventDispatcherMac::processEvents(QFlagsQEventLoop::ProcessEventsFlag) + 1425
    28 QtCore 0x0245ee61 QEventLoop::processEvents(QFlagsQEventLoop::ProcessEventsFlag) + 65
    29 QtCore 0x0245f09d QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) + 189
    30 QtCore 0x024630ee QCoreApplication::exec() + 174
    31 com.GApplication 0x00009d48 main + 2536
    32 com.GApplication 0x000090b6 start + 54

    Please provide suggestion.
    Thanks in advance

    Regards,
    Mann



  • Can you paste some code ?


  • Moderators

    How about writing a "bug report":http://bugreports.qt.nokia.com/ ?

    Issues reported to a forum tend to get lost!



  • After closing the second QMainWindow , the following function gets called on first MainWindow.

    bool MainWindow::eventFilter(QObject * object, QEvent *event)
    {
    if (event->type() == QEvent::ActivationChange)
    {
    // some activation change related stuff for the application like .updating menu , toolbar, icons etc.
    }
    else if (event->type() == QEvent::WindowActivate)
    {
    // some window activate related stuffs for the application like loading menu and toolbar, icons etc..
    }
    else if (event->type() == QEvent::WindowDeactivate)
    {
    // some window deactivate related stuffs for the application
    }

    return QMainWindow::eventFilter(object, event);
    }

    At this time of execution, two events come: first QEvent::WindowActivate and after that QEvent::ActivationChange. And stuff related to these events works well.

    And after executing this function, application crashes and debugger halt at following code of main.cpp

    int ret = app->exec();



  • Plz help me to understand the above crash report and in which situation this occurs ? and what's the reason behind it.



  • _Mann, did you actually manage to get Lion to build a debug version of your code which you can actually debug using Xcode's gdb?

    (Sorry, that I am not able to help you with your actual problem though!)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.