Cocoa QPA Menu: Clear menu items' Cocoa ancestor on destruction
Valid for both the item and the menu destructions. Task-number: QTBUG-38685 Change-Id: I024b93c8bb8facefeaad5e8b6c7be6bf049898ea Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
parent
7eae50a52d
commit
8605f44097
@ -234,6 +234,10 @@ QCocoaMenu::QCocoaMenu() :
|
||||
|
||||
QCocoaMenu::~QCocoaMenu()
|
||||
{
|
||||
foreach (QCocoaMenuItem *item, m_menuItems) {
|
||||
if (COCOA_MENU_ANCESTOR(item) == this)
|
||||
SET_COCOA_MENU_ANCESTOR(item, 0);
|
||||
}
|
||||
QCocoaAutoReleasePool pool;
|
||||
[m_nativeItem setSubmenu:nil];
|
||||
[m_nativeMenu release];
|
||||
|
@ -105,6 +105,8 @@ QCocoaMenuItem::QCocoaMenuItem() :
|
||||
|
||||
QCocoaMenuItem::~QCocoaMenuItem()
|
||||
{
|
||||
if (m_menu && COCOA_MENU_ANCESTOR(m_menu) == this)
|
||||
SET_COCOA_MENU_ANCESTOR(m_menu, 0);
|
||||
if (m_merged) {
|
||||
[m_native setHidden:YES];
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user