Commit 4accc1f1 authored by Max Kellermann's avatar Max Kellermann

test/run_neighbor_explorer: allocate ConfigData on the stack

parent 80839b53
...@@ -18,7 +18,9 @@ ...@@ -18,7 +18,9 @@
*/ */
#include "config.h" #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/Listener.hxx"
#include "neighbor/Info.hxx" #include "neighbor/Info.hxx"
#include "neighbor/Glue.hxx" #include "neighbor/Glue.hxx"
...@@ -30,17 +32,6 @@ ...@@ -30,17 +32,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
class GlobalInit {
public:
GlobalInit() {
config_global_init();
}
~GlobalInit() {
config_global_finish();
}
};
class MyNeighborListener final : public NeighborListener { class MyNeighborListener final : public NeighborListener {
public: public:
/* virtual methods from class NeighborListener */ /* virtual methods from class NeighborListener */
...@@ -67,19 +58,20 @@ try { ...@@ -67,19 +58,20 @@ try {
/* initialize the core */ /* initialize the core */
const GlobalInit init; ConfigData config;
EventLoop loop; EventLoop loop;
const ShutdownHandler shutdown_handler(loop); const ShutdownHandler shutdown_handler(loop);
/* read configuration file (mpd.conf) */ /* read configuration file (mpd.conf) */
ReadConfigFile(config_path); ReadConfigFile(config, config_path);
Migrate(config);
/* initialize neighbor plugins */ /* initialize neighbor plugins */
MyNeighborListener listener; MyNeighborListener listener;
NeighborGlue neighbor; NeighborGlue neighbor;
neighbor.Init(GetGlobalConfig(), loop, listener); neighbor.Init(config, loop, listener);
neighbor.Open(); neighbor.Open();
/* dump initial list */ /* dump initial list */
......
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