core: fix UAF faults around lock surfaces

This commit is contained in:
Vaxry 2024-02-20 01:38:02 +00:00
parent 0bcdca6e7b
commit 87a7255954
2 changed files with 8 additions and 0 deletions

View file

@ -31,6 +31,8 @@ CSessionLockSurface::~CSessionLockSurface() {
wl_egl_window_destroy(eglWindow);
ext_session_lock_surface_v1_destroy(lockSurface);
wl_surface_destroy(surface);
if (frameCallback)
wl_callback_destroy(frameCallback);
}
CSessionLockSurface::CSessionLockSurface(COutput* output) : output(output) {
@ -116,6 +118,10 @@ void CSessionLockSurface::configure(const Vector2D& size_, uint32_t serial_) {
static void handleDone(void* data, wl_callback* wl_callback, uint32_t callback_data) {
const auto PSURF = (CSessionLockSurface*)data;
if (g_pHyprlock->m_bTerminate)
return;
PSURF->onCallback();
}

View file

@ -239,6 +239,8 @@ void CHyprlock::run() {
m_sLoopState.timerCV.notify_all();
g_pRenderer->asyncResourceGatherer->notify();
m_vOutputs.clear();
wl_display_disconnect(m_sWaylandState.display);
Debug::log(LOG, "Reached the end, exiting");