From e83f805b8fa34db8ac0b885d3fb78c0e6437c908 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 10 Jan 2013 19:13:00 +0100 Subject: Main, IOThread: move GMainLoop setup code to class EventLoop --- test/run_inotify.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/run_inotify.cxx b/test/run_inotify.cxx index 2b77130d..7052210b 100644 --- a/test/run_inotify.cxx +++ b/test/run_inotify.cxx @@ -19,18 +19,19 @@ #include "config.h" #include "InotifySource.hxx" +#include "event/Loop.hxx" #include #include #include -static GMainLoop *main_loop; +static EventLoop *event_loop; static void exit_signal_handler(G_GNUC_UNUSED int signum) { - g_main_loop_quit(main_loop); + event_loop->Break(); } enum { @@ -78,7 +79,7 @@ int main(int argc, char **argv) return 2; } - main_loop = g_main_loop_new(NULL, false); + event_loop = new EventLoop(EventLoop::Default()); struct sigaction sa; sa.sa_flags = 0; @@ -87,8 +88,8 @@ int main(int argc, char **argv) sigaction(SIGINT, &sa, NULL); sigaction(SIGTERM, &sa, NULL); - g_main_loop_run(main_loop); - g_main_loop_unref(main_loop); + event_loop->Run(); mpd_inotify_source_free(source); + delete event_loop; } -- cgit v1.2.3