Cocoa: avoid a crash in QCocoaDrag
NSEvent needs to be copied. Reference: http://lists.apple.com/archives/cocoa-dev/2007/Dec/msg00678.html Task-number: QTBUG-33533 Change-Id: I73709545573e59aab6875a8c3dd903cb171e858f Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>bb10
parent
ad684ff2a7
commit
d55db6dd53
|
|
@ -55,6 +55,7 @@ class QCocoaDrag : public QPlatformDrag
|
|||
{
|
||||
public:
|
||||
QCocoaDrag();
|
||||
virtual ~QCocoaDrag();
|
||||
|
||||
virtual QMimeData *platformDropData();
|
||||
virtual Qt::DropAction drag(QDrag *m_drag);
|
||||
|
|
|
|||
|
|
@ -53,9 +53,15 @@ QCocoaDrag::QCocoaDrag() :
|
|||
m_lastView = 0;
|
||||
}
|
||||
|
||||
QCocoaDrag::~QCocoaDrag()
|
||||
{
|
||||
[m_lastEvent release];
|
||||
}
|
||||
|
||||
void QCocoaDrag::setLastMouseEvent(NSEvent *event, NSView *view)
|
||||
{
|
||||
m_lastEvent = event;
|
||||
[m_lastEvent release];
|
||||
m_lastEvent = [event copy];
|
||||
m_lastView = view;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue