Main: move code to Partition::BeginShutdown()

This commit is contained in:
Max Kellermann 2020-01-20 09:21:56 +01:00
parent f249a755e2
commit 5afec8256a
3 changed files with 10 additions and 3 deletions

View File

@ -27,7 +27,6 @@
#include "Mapper.hxx"
#include "Permission.hxx"
#include "Listen.hxx"
#include "client/Listener.hxx"
#include "client/Config.hxx"
#include "client/List.hxx"
#include "command/AllCommands.hxx"
@ -349,8 +348,7 @@ inline void
Instance::BeginShutdownPartitions() noexcept
{
for (auto &partition : partitions) {
partition.pc.Kill();
partition.listener.reset();
partition.BeginShutdown();
}
}

View File

@ -52,6 +52,13 @@ Partition::Partition(Instance &_instance,
Partition::~Partition() noexcept = default;
void
Partition::BeginShutdown() noexcept
{
pc.Kill();
listener.reset();
}
void
Partition::EmitIdle(unsigned mask) noexcept
{

View File

@ -74,6 +74,8 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
~Partition() noexcept;
void BeginShutdown() noexcept;
void EmitGlobalEvent(unsigned mask) noexcept {
global_events.OrMask(mask);
}