Commit 2395fa82 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

wayland: Fix handling of removed outputs in DpmsInterface

If an output is removed, its handle is invalid, which can lead to a
crash.


(cherry picked from commit 186ef5e5)
parent ff28dd06
Pipeline #247765 failed with stage
in 17 minutes and 27 seconds
......@@ -76,7 +76,7 @@ DpmsInterface::DpmsInterface(OutputInterface *output, wl_resource *resource)
, QtWaylandServer::org_kde_kwin_dpms(resource)
, m_output(output)
{
if (!m_output) {
if (!m_output || m_output->isRemoved()) {
return;
}
......@@ -108,7 +108,7 @@ void DpmsInterface::org_kde_kwin_dpms_destroy_resource(Resource *resource)
void DpmsInterface::org_kde_kwin_dpms_set(Resource *resource, uint32_t mode)
{
Q_UNUSED(resource)
if (!m_output) {
if (!m_output || m_output->isRemoved()) {
return;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment