Free EIS server on disable

This commit is contained in:
Gwilherm Folliot 2024-09-30 18:05:23 +02:00
parent b7ce986874
commit 1bdc7f1e82
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]() {
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;