From 4accc1f15928233a78b0ea005de92252427819a5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 19 Aug 2018 22:41:58 +0200 Subject: test/run_neighbor_explorer: allocate ConfigData on the stack --- test/run_neighbor_explorer.cxx | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'test') diff --git a/test/run_neighbor_explorer.cxx b/test/run_neighbor_explorer.cxx index 7f78826f2..ce6084c6a 100644 --- a/test/run_neighbor_explorer.cxx +++ b/test/run_neighbor_explorer.cxx @@ -18,7 +18,9 @@ */ #include "config.h" -#include "config/Global.hxx" +#include "config/File.hxx" +#include "config/Migrate.hxx" +#include "config/Data.hxx" #include "neighbor/Listener.hxx" #include "neighbor/Info.hxx" #include "neighbor/Glue.hxx" @@ -30,17 +32,6 @@ #include #include -class GlobalInit { -public: - GlobalInit() { - config_global_init(); - } - - ~GlobalInit() { - config_global_finish(); - } -}; - class MyNeighborListener final : public NeighborListener { public: /* virtual methods from class NeighborListener */ @@ -67,19 +58,20 @@ try { /* initialize the core */ - const GlobalInit init; + ConfigData config; EventLoop loop; const ShutdownHandler shutdown_handler(loop); /* read configuration file (mpd.conf) */ - ReadConfigFile(config_path); + ReadConfigFile(config, config_path); + Migrate(config); /* initialize neighbor plugins */ MyNeighborListener listener; NeighborGlue neighbor; - neighbor.Init(GetGlobalConfig(), loop, listener); + neighbor.Init(config, loop, listener); neighbor.Open(); /* dump initial list */ -- cgit v1.2.3