Skip to content

Commit 8e9add2

Browse files
authored
sessionlock: fix crash when sendScale is called on a disconnected (#12171)
1 parent 5e6cec9 commit 8e9add2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/protocols/SessionLock.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ CSessionLockSurface::CSessionLockSurface(SP<CExtSessionLockSurfaceV1> resource_,
5757
m_surface.reset();
5858
});
5959

60-
PROTO::fractional->sendScale(surface_, pMonitor_->m_scale);
60+
if (m_monitor)
61+
PROTO::fractional->sendScale(surface_, m_monitor->m_scale);
6162

6263
sendConfigure();
6364

@@ -73,6 +74,11 @@ CSessionLockSurface::~CSessionLockSurface() {
7374
}
7475

7576
void CSessionLockSurface::sendConfigure() {
77+
if (!m_monitor) {
78+
LOGM(ERR, "sendConfigure: monitor is gone");
79+
return;
80+
}
81+
7682
const auto SERIAL = g_pSeatManager->nextSerial(g_pSeatManager->seatResourceForClient(m_resource->client()));
7783
m_resource->sendConfigure(SERIAL, m_monitor->m_size.x, m_monitor->m_size.y);
7884
}

0 commit comments

Comments
 (0)