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
Liang Qi 2014-01-20 09:56:24 +01:00 committed by The Qt Project
parent a19817082c
commit 09f54e99f2
1 changed files with 5 additions and 1 deletions

View File

@ -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)