From 5a3c5827a32e04d0f19809d8c18479af426b3884 Mon Sep 17 00:00:00 2001 From: Gwilherm Folliot Date: Mon, 30 Sep 2024 18:05:23 +0200 Subject: [PATCH] Free EIS server on disable --- src/portals/InputCapture.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/portals/InputCapture.cpp b/src/portals/InputCapture.cpp index c3030b2..3567e89 100644 --- a/src/portals/InputCapture.cpp +++ b/src/portals/InputCapture.cpp @@ -99,8 +99,6 @@ void CInputCapturePortal::onCreateSession(sdbus::MethodCall& call) { session->session->onDestroy = [session, this]() { disable(session->sessionHandle); - session->eis->stopServer(); - session->eis = nullptr; Debug::log(LOG, "[input-capture] Session {} destroyed", session->sessionHandle.c_str()); session->session.release(); @@ -502,6 +500,9 @@ void CInputCapturePortal::disable(sdbus::ObjectPath sessionHandle) { if (!session->disable()) return; + session->eis->stopServer(); + session->eis.reset(); + auto signal = m_pObject->createSignal(INTERFACE_NAME, "Disable"); signal << sessionHandle;