diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 8f36b4ae..2f972335 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -351,6 +351,8 @@ void CCompositor::cleanup() { g_pXWaylandManager.reset(); g_pPointerManager.reset(); g_pSeatManager.reset(); + g_pHyprCtl.reset(); + g_pEventLoopManager.reset(); if (m_sWLRRenderer) wlr_renderer_destroy(m_sWLRRenderer); @@ -364,6 +366,7 @@ void CCompositor::cleanup() { if (m_critSigSource) wl_event_source_remove(m_critSigSource); + wl_event_loop_destroy(m_sWLEventLoop); wl_display_terminate(m_sWLDisplay); m_sWLDisplay = nullptr; diff --git a/src/events/Monitors.cpp b/src/events/Monitors.cpp index e3f8f03a..17b8ef65 100644 --- a/src/events/Monitors.cpp +++ b/src/events/Monitors.cpp @@ -188,6 +188,9 @@ void Events::listener_monitorDestroy(void* owner, void* data) { Debug::log(LOG, "Destroy called for monitor {}", pMonitor->output->name); + if (pMonitor->output->idle_frame) + wl_event_source_remove(pMonitor->output->idle_frame); + pMonitor->onDisconnect(true); pMonitor->output = nullptr; diff --git a/src/managers/ThreadManager.cpp b/src/managers/ThreadManager.cpp index cd892503..6f8e0c9a 100644 --- a/src/managers/ThreadManager.cpp +++ b/src/managers/ThreadManager.cpp @@ -25,5 +25,6 @@ CThreadManager::CThreadManager() { } CThreadManager::~CThreadManager() { - // + if (m_esConfigTimer) + wl_event_source_remove(m_esConfigTimer); } \ No newline at end of file diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 48fa92a0..4fe35c7e 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -90,6 +90,11 @@ CHyprRenderer::CHyprRenderer() { wl_event_source_timer_update(m_pCursorTicker, 500); } +CHyprRenderer::~CHyprRenderer() { + if (m_pCursorTicker) + wl_event_source_remove(m_pCursorTicker); +} + static void renderSurface(SP surface, int x, int y, void* data) { if (!surface->current.buffer || !surface->current.buffer->texture) return; diff --git a/src/render/Renderer.hpp b/src/render/Renderer.hpp index f88bfebf..60101e87 100644 --- a/src/render/Renderer.hpp +++ b/src/render/Renderer.hpp @@ -42,6 +42,7 @@ struct SSessionLockSurface; class CHyprRenderer { public: CHyprRenderer(); + ~CHyprRenderer(); void renderMonitor(CMonitor* pMonitor); void arrangeLayersForMonitor(const int&);