From fb4e0988b9997df177ab252e535d684171427df2 Mon Sep 17 00:00:00 2001 From: TuxSH Date: Tue, 13 Nov 2018 11:01:46 +0100 Subject: [PATCH] meso: KServerPort dtor --- mesosphere/source/processes/KServerPort.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mesosphere/source/processes/KServerPort.cpp b/mesosphere/source/processes/KServerPort.cpp index 518ffeb8c..513e141f9 100644 --- a/mesosphere/source/processes/KServerPort.cpp +++ b/mesosphere/source/processes/KServerPort.cpp @@ -8,9 +8,18 @@ namespace mesosphere KServerPort::~KServerPort() { - KScopedCriticalSection critsec{}; + KCriticalSection &critsec = KScheduler::GetCriticalSection(); + critsec.lock(); parent->isServerAlive = false; - // TODO + // TODO: normal sessions + lightServerSessions.clear_and_dispose( + [&critsec](KLightServerSession *s) { + critsec.unlock(); + intrusive_ptr_release(s); + critsec.lock(); + } + ); + critsec.unlock(); } bool KServerPort::IsSignaled() const