Crash when disabling action of first menubar item
-
When adding a QAction to the first menu in the menubar, and disable the action using setDisabled(true) / setDisabled(false), the app crashes.
EDIT: I am on Mac OS X 10.9, Qt 5.3.1.
Backtrace:
@Process 23018 launched: 'test' (x86_64)
Process 23018 stopped- thread #1: tid = 0xa80cd, 0x00007fff72f06f30 AppKit
NSRegion, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x7fff72f06f30) frame #0: 0x00007fff72f06f30 AppKit
NSRegion
AppKit`NSRegion:
-> 0x7fff72f06f30: cmpb %bh, 0x45(%rax)
0x7fff72f06f33: jne 0x7fff72f06f34 ; (void *)0x7545783800007fff
0x7fff72f06f35: jg 0x7fff72f06f37 ; (void *)0x007fff7545783800
0x7fff72f06f37: addb %bh, (%rax)
(lldb) bt - thread #1: tid = 0xa80cd, 0x00007fff72f06f30 AppKit`NSRegion, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x7fff72f06f30)
- frame #0: 0x00007fff72f06f30 AppKit
NSRegion frame #1: 0x0000000100ca92fc QtCore
QMetaObject::cast(QObject*) const + 28
frame #2: 0x0000000103e259fe libqcocoa.dylibQtPrivate::QVariantValueHelper<QObject*>::object(QVariant const&) + 94 frame #3: 0x0000000103e26307 libqcocoa.dylib
QCocoaMenuItem::sync() + 631
frame #4: 0x0000000103e247c3 libqcocoa.dylibQCocoaMenu::syncMenuItem(QPlatformMenuItem*) + 275 frame #5: 0x0000000101205bfa QtWidgets
QMenu::actionEvent(QActionEvent*) + 794
frame #6: 0x00000001010dce60 QtWidgetsQWidget::event(QEvent*) + 1024 frame #7: 0x0000000101203e46 QtWidgets
QMenu::event(QEvent*) + 950
frame #8: 0x00000001010a24ec QtWidgetsQApplicationPrivate::notify_helper(QObject*, QEvent*) + 252 frame #9: 0x00000001010a58ca QtWidgets
QApplication::notify(QObject*, QEvent*) + 8490
frame #10: 0x0000000100ca3423 QtCoreQCoreApplication::notifyInternal(QObject*, QEvent*) + 115 frame #11: 0x0000000101097ed1 QtWidgets
QActionPrivate::sendDataChanged() + 113
frame #12: 0x000000010109a182 QtWidgets`QAction::setEnabled(bool) + 194@
- frame #0: 0x00007fff72f06f30 AppKit
- thread #1: tid = 0xa80cd, 0x00007fff72f06f30 AppKit
-
Is it simple app generated by a wizard or it is part of large app?
A piece of source code may help to identify a problem. -
No, it is handcoded and it is a large app, so I cannot share the exact code. But I will try to compile a simple example.