diff options
| author | github-usr-name <github-usr-name@users.noreply.github.com> | 2024-02-26 09:52:12 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-26 09:52:12 +0000 |
| commit | 81fe2ae7f1da7578ac5208158c5bbc4d079effa3 (patch) | |
| tree | 9e325d6fcd5ac0a4a1e6bdeca706ef5fb1001c6e /src/helpers/WLSurface.cpp | |
| parent | dfcfb92ec611345848f3840d34d66b8501e6367c (diff) | |
surface: ensure global pointers valid before using in destructor (#4844)
This fixes an observed SigSegV resulting from the cursor surface using
`g_pInputManager` when invoked from the `CInputManager` destructor
Co-authored-by: github-user-name <spam-here@github.com>
Diffstat (limited to 'src/helpers/WLSurface.cpp')
| -rw-r--r-- | src/helpers/WLSurface.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/helpers/WLSurface.cpp b/src/helpers/WLSurface.cpp index ea34fbd4..25f11feb 100644 --- a/src/helpers/WLSurface.cpp +++ b/src/helpers/WLSurface.cpp @@ -83,11 +83,11 @@ void CWLSurface::destroy() { m_pWLRSurface->data = nullptr; m_pOwner = nullptr; - if (g_pCompositor->m_pLastFocus == m_pWLRSurface) + if (g_pCompositor && g_pCompositor->m_pLastFocus == m_pWLRSurface) g_pCompositor->m_pLastFocus = nullptr; - if (g_pInputManager->m_pLastMouseSurface == m_pWLRSurface) + if (g_pInputManager && g_pInputManager->m_pLastMouseSurface == m_pWLRSurface) g_pInputManager->m_pLastMouseSurface = nullptr; - if (g_pHyprRenderer->m_sLastCursorData.surf == m_pWLRSurface) + if (g_pHyprRenderer && g_pHyprRenderer->m_sLastCursorData.surf == m_pWLRSurface) g_pHyprRenderer->m_sLastCursorData.surf.reset(); m_pWLRSurface = nullptr; |
