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:
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);

View file

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

View file

@ -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);