Commit 5afec825 authored by Max Kellermann's avatar Max Kellermann

Main: move code to Partition::BeginShutdown()

parent f249a755
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include "Mapper.hxx" #include "Mapper.hxx"
#include "Permission.hxx" #include "Permission.hxx"
#include "Listen.hxx" #include "Listen.hxx"
#include "client/Listener.hxx"
#include "client/Config.hxx" #include "client/Config.hxx"
#include "client/List.hxx" #include "client/List.hxx"
#include "command/AllCommands.hxx" #include "command/AllCommands.hxx"
...@@ -349,8 +348,7 @@ inline void ...@@ -349,8 +348,7 @@ inline void
Instance::BeginShutdownPartitions() noexcept Instance::BeginShutdownPartitions() noexcept
{ {
for (auto &partition : partitions) { for (auto &partition : partitions) {
partition.pc.Kill(); partition.BeginShutdown();
partition.listener.reset();
} }
} }
......
...@@ -53,6 +53,13 @@ Partition::Partition(Instance &_instance, ...@@ -53,6 +53,13 @@ Partition::Partition(Instance &_instance,
Partition::~Partition() noexcept = default; Partition::~Partition() noexcept = default;
void void
Partition::BeginShutdown() noexcept
{
pc.Kill();
listener.reset();
}
void
Partition::EmitIdle(unsigned mask) noexcept Partition::EmitIdle(unsigned mask) noexcept
{ {
instance.EmitIdle(mask); instance.EmitIdle(mask);
......
...@@ -74,6 +74,8 @@ struct Partition final : QueueListener, PlayerListener, MixerListener { ...@@ -74,6 +74,8 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
~Partition() noexcept; ~Partition() noexcept;
void BeginShutdown() noexcept;
void EmitGlobalEvent(unsigned mask) noexcept { void EmitGlobalEvent(unsigned mask) noexcept {
global_events.OrMask(mask); global_events.OrMask(mask);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment