From 38f19dafb26fe85b3930ab472a3aa4c1fc4fb7e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 16 Nov 2015 14:14:07 +0100 Subject: [PATCH] Add safety check to Deleted::~Deleted for tear-down It's possible that the Deleted gets created before destroying Workspace and due to the deleteLater outlives Workspace. In that case we may not call into Workspace as this might crash. --- deleted.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deleted.cpp b/deleted.cpp index fc557d7430..8fbd334f53 100644 --- a/deleted.cpp +++ b/deleted.cpp @@ -50,7 +50,9 @@ Deleted::~Deleted() if (delete_refcount != 0) qCCritical(KWIN_CORE) << "Deleted client has non-zero reference count (" << delete_refcount << ")"; assert(delete_refcount == 0); - workspace()->removeDeleted(this); + if (workspace()) { + workspace()->removeDeleted(this); + } deleteEffectWindow(); }