Cocoa: QNSView - fix memory leak of QNSViewMenuHelper

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

Pick-to: 6.9 6.8 6.5
Fixes: QTBUG-131655
Fixes: QTBUG-137161
Change-Id: I783c400d1300046118ad3e12816e84709cc9d793
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c8ebe2e5cd71250d4515e09c29a3045b0cbe49a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tim Blechmann 2025-06-01 16:19:51 +08:00 committed by Qt Cherry-pick Bot
parent 9237cdf98f
commit 46c82ac228

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];