core: Add missing destructors causing segfaults (#199)

Co-authored-by: Staz M <staz@staz.io>
This commit is contained in:
Staz Modrzynski 2024-03-17 11:44:37 -04:00 committed by GitHub
parent 23224d40e4
commit 2ae79757d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 0 deletions

View File

@ -69,6 +69,12 @@ CEGL::CEGL(wl_display* display) {
error: error:
eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); 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) if (eglDisplay)
eglTerminate(eglDisplay); eglTerminate(eglDisplay);

View File

@ -9,6 +9,7 @@
class CEGL { class CEGL {
public: public:
CEGL(wl_display*); CEGL(wl_display*);
~CEGL();
EGLDisplay eglDisplay; EGLDisplay eglDisplay;
EGLConfig eglConfig; EGLConfig eglConfig;

View File

@ -519,6 +519,9 @@ void CHyprlock::run() {
m_vOutputs.clear(); m_vOutputs.clear();
g_pEGL.reset(); g_pEGL.reset();
g_pRenderer = nullptr;
xkb_context_unref(m_pXKBContext);
wl_display_disconnect(m_sWaylandState.display); wl_display_disconnect(m_sWaylandState.display);