diff --git a/src/core/Egl.cpp b/src/core/Egl.cpp index 71956a6..4a0d0b3 100644 --- a/src/core/Egl.cpp +++ b/src/core/Egl.cpp @@ -69,6 +69,12 @@ CEGL::CEGL(wl_display* display) { error: eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); +} + +CEGL::~CEGL() { + if (eglContext != EGL_NO_CONTEXT) + eglDestroyContext(eglDisplay, eglContext); + if (eglDisplay) eglTerminate(eglDisplay); diff --git a/src/core/Egl.hpp b/src/core/Egl.hpp index 55f1db0..52cbb59 100644 --- a/src/core/Egl.hpp +++ b/src/core/Egl.hpp @@ -9,6 +9,7 @@ class CEGL { public: CEGL(wl_display*); + ~CEGL(); EGLDisplay eglDisplay; EGLConfig eglConfig; diff --git a/src/core/hyprlock.cpp b/src/core/hyprlock.cpp index 98f5f4b..62ee383 100644 --- a/src/core/hyprlock.cpp +++ b/src/core/hyprlock.cpp @@ -519,6 +519,9 @@ void CHyprlock::run() { m_vOutputs.clear(); g_pEGL.reset(); + g_pRenderer = nullptr; + + xkb_context_unref(m_pXKBContext); wl_display_disconnect(m_sWaylandState.display);