Instance: add method Shutdown()
This commit is contained in:
parent
8e563cbccd
commit
23ab4e5e5f
@ -22,6 +22,7 @@
|
|||||||
#include "Partition.hxx"
|
#include "Partition.hxx"
|
||||||
#include "Idle.hxx"
|
#include "Idle.hxx"
|
||||||
#include "Stats.hxx"
|
#include "Stats.hxx"
|
||||||
|
#include "event/Loop.hxx"
|
||||||
#include "util/Error.hxx"
|
#include "util/Error.hxx"
|
||||||
|
|
||||||
#ifdef ENABLE_DATABASE
|
#ifdef ENABLE_DATABASE
|
||||||
@ -32,6 +33,15 @@
|
|||||||
#include "sticker/StickerDatabase.hxx"
|
#include "sticker/StickerDatabase.hxx"
|
||||||
#include "sticker/SongSticker.hxx"
|
#include "sticker/SongSticker.hxx"
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void
|
||||||
|
Instance::Shutdown()
|
||||||
|
{
|
||||||
|
event_loop->Break();
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_DATABASE
|
||||||
|
|
||||||
Database *
|
Database *
|
||||||
Instance::GetDatabase(Error &error)
|
Instance::GetDatabase(Error &error)
|
||||||
|
@ -76,6 +76,11 @@ struct Instance final
|
|||||||
|
|
||||||
Partition *partition;
|
Partition *partition;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initiate shutdown. Wrapper for EventLoop::Break().
|
||||||
|
*/
|
||||||
|
void Shutdown();
|
||||||
|
|
||||||
#ifdef ENABLE_DATABASE
|
#ifdef ENABLE_DATABASE
|
||||||
/**
|
/**
|
||||||
* Returns the global #Database instance. May return nullptr
|
* Returns the global #Database instance. May return nullptr
|
||||||
|
@ -393,7 +393,7 @@ idle_event_emitted(void)
|
|||||||
static void
|
static void
|
||||||
shutdown_event_emitted(void)
|
shutdown_event_emitted(void)
|
||||||
{
|
{
|
||||||
instance->event_loop->Break();
|
instance->Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user