diff options
| author | Matteo Golinelli <34921879+Golim@users.noreply.github.com> | 2025-10-31 01:15:18 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-31 00:15:18 +0000 |
| commit | 8e9add2afda58d233a75e4c5ce8503b24fa59ceb (patch) | |
| tree | 4a9b91d3f925f8a02f1172d3c33cc3b07abd24e4 /src/protocols/SessionLock.cpp | |
| parent | 5e6cec962c780956177e56355ffc1d64cc5f83ca (diff) | |
sessionlock: fix crash when sendScale is called on a disconnected (#12171)
Diffstat (limited to 'src/protocols/SessionLock.cpp')
| -rw-r--r-- | src/protocols/SessionLock.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/protocols/SessionLock.cpp b/src/protocols/SessionLock.cpp index 66e10311..6ff9171e 100644 --- a/src/protocols/SessionLock.cpp +++ b/src/protocols/SessionLock.cpp @@ -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); } |
