Cocoa: avoid a crash for cursor in QCocoaWindow
It need to be copied. Task-number: QTBUG-35887 Change-Id: Ia165e6a8f9dc23733e53e11f9e1e98bf54e7dd20 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>bb10
parent
a19817082c
commit
09f54e99f2
|
|
@ -264,6 +264,7 @@ QCocoaWindow::~QCocoaWindow()
|
|||
[m_contentView release];
|
||||
[m_nsWindow release];
|
||||
[m_nsWindowDelegate release];
|
||||
[m_windowCursor release];
|
||||
}
|
||||
|
||||
QSurfaceFormat QCocoaWindow::format() const
|
||||
|
|
@ -1059,7 +1060,10 @@ void QCocoaWindow::setWindowCursor(NSCursor *cursor)
|
|||
[cursor set];
|
||||
// or we can set the cursor on mouse enter/leave using tracking
|
||||
// areas. This is done in QNSView, save the cursor:
|
||||
m_windowCursor = cursor;
|
||||
if (m_windowCursor != cursor) {
|
||||
[m_windowCursor release];
|
||||
m_windowCursor = [cursor retain];
|
||||
}
|
||||
}
|
||||
|
||||
void QCocoaWindow::registerTouch(bool enable)
|
||||
|
|
|
|||
Loading…
Reference in New Issue