Verify Workspace pointer in X11EventFilter::~X11EventFilter
In case the inheriting class of X11EventFilter is a child of Workspace and deleted by the QObject dtor of Workspace the Workspace::self() pointer is no longer valid and already set to nullptr.
This commit is contained in:
parent
b7a8bb4f52
commit
7c62cd19ef
1 changed files with 3 additions and 1 deletions
|
@ -32,7 +32,9 @@ X11EventFilter::X11EventFilter(int eventType, int opcode, int genericEventType)
|
|||
|
||||
X11EventFilter::~X11EventFilter()
|
||||
{
|
||||
Workspace::self()->unregisterEventFilter(this);
|
||||
if (auto w = Workspace::self()) {
|
||||
w->unregisterEventFilter(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue