summaryrefslogtreecommitdiff
path: root/src/render/Texture.cpp
diff options
context:
space:
mode:
authorTom Englund <tomenglund26@gmail.com>2024-06-28 22:24:32 +0200
committerGitHub <noreply@github.com>2024-06-28 22:24:32 +0200
commitac11771348146087eb577d20162ec10a81358a7e (patch)
treef7816531db23eef32b310af6ec0387898d3b501b /src/render/Texture.cpp
parentf2dc48d92f340efe6d4264b92d38378c18a3e1ea (diff)
core: fix a few ubsan issues reported at exit of hyprland (#6699)
* watchdog: dont detach and cause race condition instead of detaching and causing a race condition on destruction where the thread is alive and watchdog has been destroyed, check if its joinable and join it on destruction. causes heap use after free on exit of compositor. * render: add checks for compositor shutting down avoid member call on null pointer, if the g_pHyprRenderer is destroyed we can call the member makeEGLCurrent on it, causes undefined behaviour on destruction of the compositor/hyprrenderer. found with ubsan.
Diffstat (limited to 'src/render/Texture.cpp')
-rw-r--r--src/render/Texture.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/render/Texture.cpp b/src/render/Texture.cpp
index 5560db97..46c501a0 100644
--- a/src/render/Texture.cpp
+++ b/src/render/Texture.cpp
@@ -9,7 +9,7 @@ CTexture::CTexture() {
}
CTexture::~CTexture() {
- if (m_bNonOwning)
+ if (m_bNonOwning || !g_pCompositor || g_pCompositor->m_bIsShuttingDown || !g_pHyprRenderer)
return;
g_pHyprRenderer->makeEGLCurrent();