input/Init: add RAII class

This commit is contained in:
Max Kellermann
2019-02-05 21:50:31 +01:00
parent b0739eca87
commit 9e73ea77b4
9 changed files with 39 additions and 39 deletions

View File

@@ -42,15 +42,13 @@ class GlobalInit {
const ScopeArchivePluginsInit archive_plugins_init;
#endif
public:
GlobalInit() {
io_thread.Start();
input_stream_global_init(ConfigData(),
io_thread.GetEventLoop());
}
const ScopeInputPluginsInit input_plugins_init;
~GlobalInit() {
input_stream_global_finish();
public:
GlobalInit()
:input_plugins_init(ConfigData(), io_thread.GetEventLoop())
{
io_thread.Start();
}
};