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.
This commit is contained in:
Martin Gräßlin 2015-11-16 14:14:07 +01:00
parent deb63fa344
commit 38f19dafb2

View file

@ -50,7 +50,9 @@ Deleted::~Deleted()
if (delete_refcount != 0) if (delete_refcount != 0)
qCCritical(KWIN_CORE) << "Deleted client has non-zero reference count (" << delete_refcount << ")"; qCCritical(KWIN_CORE) << "Deleted client has non-zero reference count (" << delete_refcount << ")";
assert(delete_refcount == 0); assert(delete_refcount == 0);
workspace()->removeDeleted(this); if (workspace()) {
workspace()->removeDeleted(this);
}
deleteEffectWindow(); deleteEffectWindow();
} }