mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-09 23:45:58 +01:00
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>
This commit is contained in:
parent
dfcfb92ec6
commit
81fe2ae7f1
1 changed files with 3 additions and 3 deletions
|
@ -83,11 +83,11 @@ void CWLSurface::destroy() {
|
||||||
m_pWLRSurface->data = nullptr;
|
m_pWLRSurface->data = nullptr;
|
||||||
m_pOwner = 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;
|
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;
|
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();
|
g_pHyprRenderer->m_sLastCursorData.surf.reset();
|
||||||
|
|
||||||
m_pWLRSurface = nullptr;
|
m_pWLRSurface = nullptr;
|
||||||
|
|
Loading…
Reference in a new issue