Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.9.2, 5.10.1, 5.11.0 RC 1
-
-
b854772676ff2b0e610b522279c997618496c050
Description
Sometimes the application crashes in qcocoamenu.mm
- (BOOL)validateMenuItem:(NSMenuItem*)menuItem
I debugged it by adding a bunch of logging to the validateMenuItem, the places where the NSMenuItem is released and to the constructor and destructor of QCocoaMenuItem and noticed that when it crashes the QCocoaMenuItem it tries to use in validateMenuItem is already destroyed.
The NSMenuItem can be released in multiple different places and none of them update the tag of it. Calling release for the item doesn't necessarily cause it to be deallocated since it only reduces the reference count of it and thus the tag will still point to the QCocoaMenuItem and when that QCocoaMenuItem gets destroyed the NSMenuItem will point to already released memory.
Attachments
For Gerrit Dashboard: QTBUG-64464 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
241134,3 | Menu: Provide a safe clear() function | 5.12 | qt/qtquickcontrols | Status: MERGED | +2 | 0 |