diff options
| author | AbĂlio Costa <abmantis@users.noreply.github.com> | 2024-02-01 03:09:31 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-01 03:09:31 +0000 |
| commit | 15316aaa311ce27982d4df3c9514f042290853a3 (patch) | |
| tree | 380dae8e1421b6b78f980f250f922dd8e5a5adf8 /src/helpers/SubsurfaceTree.cpp | |
| parent | cfd68af5b6c26f244838b628cf375b9cc0c5cfdf (diff) | |
subsurfaceTree: Fix nullptr crash when disconnecting a monitor (#4577)
I was able to reproduce this frequently by having a kitty terminal on an
monitor running the following command and then unplugging that monitor:
`while true; do echo "" && sleep 0.02; done`
Diffstat (limited to 'src/helpers/SubsurfaceTree.cpp')
| -rw-r--r-- | src/helpers/SubsurfaceTree.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/helpers/SubsurfaceTree.cpp b/src/helpers/SubsurfaceTree.cpp index f9b1cb72..a8226e19 100644 --- a/src/helpers/SubsurfaceTree.cpp +++ b/src/helpers/SubsurfaceTree.cpp @@ -262,7 +262,7 @@ void Events::listener_commitSubsurface(void* owner, void* data) { // tearing: if solitary, redraw it. This still might be a single surface window const auto PMONITOR = g_pCompositor->getMonitorFromID(pNode->pWindowOwner->m_iMonitorID); - if (PMONITOR->solitaryClient == pNode->pWindowOwner && pNode->pWindowOwner->canBeTorn() && PMONITOR->tearingState.canTear && + if (PMONITOR && PMONITOR->solitaryClient == pNode->pWindowOwner && pNode->pWindowOwner->canBeTorn() && PMONITOR->tearingState.canTear && pNode->pSurface->wlr()->current.committed & WLR_SURFACE_STATE_BUFFER) { CRegion damageBox{&pNode->pSurface->wlr()->buffer_damage}; |
