Fix crash for destroyed surface on touch event

Change-Id: Ia3dd8627c1b96a88d308dc7fa85d936f809c7856
Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
This commit is contained in:
Elvis Lee 2016-01-29 11:31:06 +09:00 committed by Paul Olav Tvete
parent c70987cd65
commit f52b53996c

View File

@ -253,6 +253,8 @@ void QWaylandInputDevice::handleWindowDestroyed(QWaylandWindow *window)
mKeyboard->mFocus = 0;
mKeyboard->stopRepeat();
}
if (mTouch && window == mTouch->mFocus)
mTouch->mFocus = 0;
}
void QWaylandInputDevice::setDataDevice(QWaylandDataDevice *device)
@ -739,6 +741,9 @@ void QWaylandInputDevice::Touch::touch_down(uint32_t serial,
wl_fixed_t x,
wl_fixed_t y)
{
if (!surface)
return;
mParent->mTime = time;
mParent->mSerial = serial;
mFocus = QWaylandWindow::fromWlSurface(surface);