output/xdg-output: avoid sending events to released globals

ref #6835
This commit is contained in:
Vaxry 2024-10-09 00:26:40 +01:00
parent ac658500fb
commit bc299928ad
3 changed files with 9 additions and 2 deletions

View file

@ -47,7 +47,7 @@ SP<CWlOutput> CWLOutputResource::getResource() {
}
void CWLOutputResource::updateState() {
if (!monitor || (owner && owner->defunct))
if (!monitor || !owner || owner->defunct)
return;
if (resource->version() >= 2)
@ -119,6 +119,9 @@ bool CWLOutputProtocol::isDefunct() {
}
void CWLOutputProtocol::sendDone() {
if (defunct)
return;
for (auto const& r : m_vOutputs) {
r->resource->sendDone();
}