Cocoa: QNSView - fix memory leak of QNSViewMenuHelper

QNSViewMenuHelper is leaked, as dealloc did not nil it to decrement the
reference count.

Pick-to: 6.5 6.8 6.9 6.10
Fixes: QTBUG-131655
Fixes: QTBUG-137161
Change-Id: I783c400d1300046118ad3e12816e84709cc9d793
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Tim Blechmann 2025-06-01 16:19:51 +08:00
parent ab7a80a955
commit c8ebe2e5cd

View File

@ -168,6 +168,8 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSViewMenuHelper);
{
qCDebug(lcQpaWindow) << "Deallocating" << self;
self.menuHelper = nil;
[[NSNotificationCenter defaultCenter] removeObserver:self];
[m_mouseMoveHelper release];