diff --git a/awesome.c b/awesome.c index 952b1939..08d136ad 100644 --- a/awesome.c +++ b/awesome.c @@ -621,9 +621,12 @@ main(int argc, char **argv) g_main_context_set_poll_func(g_main_context_default(), &a_glib_poll); gettimeofday(&last_wakeup, NULL); - /* main event loop */ - globalconf.loop = g_main_loop_new(NULL, FALSE); - g_main_loop_run(globalconf.loop); + /* main event loop (if not NULL, awesome.quit() was already called) */ + if (globalconf.loop == NULL) + { + globalconf.loop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(globalconf.loop); + } g_main_loop_unref(globalconf.loop); globalconf.loop = NULL; diff --git a/luaa.c b/luaa.c index 577ed98b..a5a2cf5d 100644 --- a/luaa.c +++ b/luaa.c @@ -111,6 +111,8 @@ composite_manager_running(void) static int luaA_quit(lua_State *L) { + if (globalconf.loop == NULL) + globalconf.loop = g_main_loop_new(NULL, FALSE); g_main_loop_quit(globalconf.loop); return 0; }