From 936c52e2631d1236f3f5dcaad05b66a7ebc41186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 9 Nov 2015 16:24:13 +0100 Subject: [PATCH] Check whether Cursor is valid before using from EffectsHandler mousePolling During tear down Compositor and Effect system might be destroyed after Cursor. Thus we need to ensure that we don't call into Cursor unconditonally. --- effects.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/effects.cpp b/effects.cpp index 53f4f5c251..5ccf94f6c8 100644 --- a/effects.cpp +++ b/effects.cpp @@ -769,12 +769,14 @@ void* EffectsHandlerImpl::getProxy(QString name) void EffectsHandlerImpl::startMousePolling() { - Cursor::self()->startMousePolling(); + if (Cursor::self()) + Cursor::self()->startMousePolling(); } void EffectsHandlerImpl::stopMousePolling() { - Cursor::self()->stopMousePolling(); + if (Cursor::self()) + Cursor::self()->stopMousePolling(); } bool EffectsHandlerImpl::hasKeyboardGrab() const