Commit cd0e9287 authored by Max Kellermann's avatar Max Kellermann

test/DumpDatabase: start an EventThread

Our local EventLoop instance was never run; it was not usable.
parent 9033f077
......@@ -1766,6 +1766,7 @@ test_DumpDatabase_LDADD = \
$(TAG_LIBS) \
libconf.a \
libevent.a \
libthread.a \
$(FS_LIBS) \
libsystem.a \
$(ICU_LDADD) \
......
......@@ -31,7 +31,7 @@
#include "config/Block.hxx"
#include "tag/Config.hxx"
#include "fs/Path.hxx"
#include "event/Loop.hxx"
#include "event/Thread.hxx"
#include "Log.hxx"
#include "util/ScopeExit.hxx"
......@@ -44,14 +44,21 @@ using std::endl;
#include <stdlib.h>
class GlobalInit {
EventThread io_thread;
public:
GlobalInit() {
io_thread.Start();
config_global_init();
}
~GlobalInit() {
config_global_finish();
}
EventLoop &GetEventLoop() {
return io_thread.GetEventLoop();
}
};
#ifdef ENABLE_UPNP
......@@ -121,7 +128,6 @@ try {
TagLoadConfig();
EventLoop event_loop;
MyDatabaseListener database_listener;
/* do it */
......@@ -131,7 +137,8 @@ try {
if (path != nullptr)
block.AddBlockParam("path", path->value.c_str(), path->line);
Database *db = plugin->create(event_loop, database_listener, block);
Database *db = plugin->create(init.GetEventLoop(),
database_listener, block);
AtScopeExit(db) { delete db; };
......
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