From ec77a7037586864ece6505c448ab5c15bf8a57d9 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 10 May 2016 17:25:12 -0400 Subject: refactor how submodules are handled let them own their own memory, so that they can free themselves once they exit the loop. also split out the parts of the terminal that we only want to initialize once, even if we open multiple terminal windows --- src/runes.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/runes.c') diff --git a/src/runes.c b/src/runes.c index af32778..46aaf41 100644 --- a/src/runes.c +++ b/src/runes.c @@ -1,27 +1,27 @@ #include -#include #include "runes.h" #include "loop.h" #include "term.h" +#include "window-xlib.h" int main (int argc, char *argv[]) { - RunesLoop loop; - RunesTerm *t; + RunesLoop *loop; + RunesWindowBackendGlobal *wg; setlocale(LC_ALL, ""); - runes_loop_init(&loop); + loop = runes_loop_new(); + wg = runes_window_backend_global_init(); + runes_term_register_with_loop(runes_term_new(argc, argv, wg), loop); - t = calloc(1, sizeof(RunesTerm)); - runes_term_init(t, &loop, argc, argv); - - runes_loop_run(&loop); + runes_loop_run(loop); #ifdef RUNES_VALGRIND - runes_loop_cleanup(&loop); + runes_loop_cleanup(loop); + runes_window_backend_global_cleanup(wg); #endif return 0; -- cgit v1.2.3-54-g00ecf