summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2019-08-20 14:12:51 +0200
committerJohan Klokkhammer Helsing <johan.helsing@qt.io>2019-08-27 09:02:04 +0200
commit4400d48cb6e8ab1b8676e198d4882b7a52310935 (patch)
treed507e9906c1366cf30aff8d059b52fa568fea1bf
parentc744945d9c7e26503272a30827762c8098f21e4c (diff)
downloadqtwayland-4400d48cb6e8ab1b8676e198d4882b7a52310935.tar.gz
Client: Don't try to disconnect destroy handler from destroyed objects
Gets rid of warning about disconnecting null objects on application exit. Change-Id: Ie96d4321dfab113622d7059f6849acf15715dfa2 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
-rw-r--r--src/client/qwaylandinputdevice.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index 65f80f30..8aa0239d 100644
--- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp
@@ -789,8 +789,10 @@ void QWaylandInputDevice::Pointer::pointer_button(uint32_t serial, uint32_t time
void QWaylandInputDevice::Pointer::invalidateFocus()
{
- disconnect(mFocus.data(), &QObject::destroyed, this, &Pointer::handleFocusDestroyed);
- mFocus = nullptr;
+ if (mFocus) {
+ disconnect(mFocus.data(), &QObject::destroyed, this, &Pointer::handleFocusDestroyed);
+ mFocus = nullptr;
+ }
mEnterSerial = 0;
}