diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2014-04-23 11:32:44 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-25 14:04:42 +0200 |
commit | 079f2bf5d8a4221b821ec8062affe2efaa9668a0 (patch) | |
tree | 7cb6d7dcadd3b5c683367636305d862988f3e0f7 /src/plugins/platforms/cocoa/qnsview.mm | |
parent | 55d1aa3121063fcb41f8f4500c4319b64ca8ee67 (diff) |
Cocoa: Fix crash on Combobox popup close.
Regression caused by 0be1c4899c.
The calls to handleCloseEvent/flushWindowSystemEvents
may result in popup window deletion and a stale/null
pointer access.
Get the window type before closing it.
Task-number: QTBUG-38418
Change-Id: I212a56979e0248076e1eb5bf9ede1ff0d424e041
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.mm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 93462e7ea1..4065b57e46 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -637,9 +637,9 @@ static QTouchDevice *touchDevice = 0; return [super mouseDown:theEvent]; m_sendUpAsRightButton = false; if (m_platformWindow->m_activePopupWindow) { + Qt::WindowType type = m_platformWindow->m_activePopupWindow->type(); QWindowSystemInterface::handleCloseEvent(m_platformWindow->m_activePopupWindow); QWindowSystemInterface::flushWindowSystemEvents(); - Qt::WindowType type = m_platformWindow->m_activePopupWindow->type(); m_platformWindow->m_activePopupWindow = 0; // Consume the mouse event when closing the popup, except for tool tips // were it's expected that the event is processed normally. |