sessionlock: fix crash when sendScale is called on a disconnected (#12171)

This commit is contained in:
Matteo Golinelli 2025-10-31 01:15:18 +01:00 committed by GitHub
parent 5e6cec962c
commit 8e9add2afd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -57,7 +57,8 @@ CSessionLockSurface::CSessionLockSurface(SP<CExtSessionLockSurfaceV1> resource_,
m_surface.reset();
});
PROTO::fractional->sendScale(surface_, pMonitor_->m_scale);
if (m_monitor)
PROTO::fractional->sendScale(surface_, m_monitor->m_scale);
sendConfigure();
@ -73,6 +74,11 @@ CSessionLockSurface::~CSessionLockSurface() {
}
void CSessionLockSurface::sendConfigure() {
if (!m_monitor) {
LOGM(ERR, "sendConfigure: monitor is gone");
return;
}
const auto SERIAL = g_pSeatManager->nextSerial(g_pSeatManager->seatResourceForClient(m_resource->client()));
m_resource->sendConfigure(SERIAL, m_monitor->m_size.x, m_monitor->m_size.y);
}