summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-02-05 21:50:31 +0100
committerMax Kellermann <max@musicpd.org>2019-02-05 22:07:49 +0100
commit9e73ea77b4ccd4131823ddc156322a2e4082d417 (patch)
tree50a5ed0b8b1eafd0e130ff757e700b9bda780504 /src/input
parentb0739eca87439a8f9cc2a0f9a6fcba1f68708df6 (diff)
input/Init: add RAII class
Diffstat (limited to 'src/input')
-rw-r--r--src/input/Init.hxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/input/Init.hxx b/src/input/Init.hxx
index cba1a663e..ed6615131 100644
--- a/src/input/Init.hxx
+++ b/src/input/Init.hxx
@@ -35,4 +35,16 @@ input_stream_global_init(const ConfigData &config, EventLoop &event_loop);
void
input_stream_global_finish() noexcept;
+class ScopeInputPluginsInit {
+public:
+ ScopeInputPluginsInit(const ConfigData &config,
+ EventLoop &event_loop) {
+ input_stream_global_init(config, event_loop);
+ }
+
+ ~ScopeInputPluginsInit() noexcept {
+ input_stream_global_finish();
+ }
+};
+
#endif