Free EIS server on disable

This commit is contained in:
Gwilherm Folliot 2024-09-30 18:05:23 +02:00
parent 44ba88d82c
commit 5a3c5827a3
No known key found for this signature in database
GPG key ID: 90236D3623DCD660

View file

@ -99,8 +99,6 @@ void CInputCapturePortal::onCreateSession(sdbus::MethodCall& call) {
session->session->onDestroy = [session, this]() { session->session->onDestroy = [session, this]() {
disable(session->sessionHandle); disable(session->sessionHandle);
session->eis->stopServer();
session->eis = nullptr;
Debug::log(LOG, "[input-capture] Session {} destroyed", session->sessionHandle.c_str()); Debug::log(LOG, "[input-capture] Session {} destroyed", session->sessionHandle.c_str());
session->session.release(); session->session.release();
@ -502,6 +500,9 @@ void CInputCapturePortal::disable(sdbus::ObjectPath sessionHandle) {
if (!session->disable()) if (!session->disable())
return; return;
session->eis->stopServer();
session->eis.reset();
auto signal = m_pObject->createSignal(INTERFACE_NAME, "Disable"); auto signal = m_pObject->createSignal(INTERFACE_NAME, "Disable");
signal << sessionHandle; signal << sessionHandle;