Commit 23ab4e5e authored by Max Kellermann's avatar Max Kellermann

Instance: add method Shutdown()

parent 8e563cbc
......@@ -22,6 +22,7 @@
#include "Partition.hxx"
#include "Idle.hxx"
#include "Stats.hxx"
#include "event/Loop.hxx"
#include "util/Error.hxx"
#ifdef ENABLE_DATABASE
......@@ -32,6 +33,15 @@
#include "sticker/StickerDatabase.hxx"
#include "sticker/SongSticker.hxx"
#endif
#endif
void
Instance::Shutdown()
{
event_loop->Break();
}
#ifdef ENABLE_DATABASE
Database *
Instance::GetDatabase(Error &error)
......
......@@ -76,6 +76,11 @@ struct Instance final
Partition *partition;
/**
* Initiate shutdown. Wrapper for EventLoop::Break().
*/
void Shutdown();
#ifdef ENABLE_DATABASE
/**
* Returns the global #Database instance. May return nullptr
......
......@@ -393,7 +393,7 @@ idle_event_emitted(void)
static void
shutdown_event_emitted(void)
{
instance->event_loop->Break();
instance->Shutdown();
}
#endif
......
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