diff options
author | kotontrion <[email protected]> | 2024-06-20 17:01:25 +0200 |
---|---|---|
committer | kotontrion <[email protected]> | 2024-06-20 17:01:25 +0200 |
commit | faf40c60dc60683fa3698d15bb6955f1f5ea6185 (patch) | |
tree | 7bc5e12c79b537450ccb744e0a8b05df3533c94b /src/astal-river.c | |
parent | 36ce3262ac1f137866bf7f94a2ffea8c6c6fcee6 (diff) |
automatically init object on creation
fix object finalize
Diffstat (limited to 'src/astal-river.c')
-rw-r--r-- | src/astal-river.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/astal-river.c b/src/astal-river.c index cb04d45..000f26c 100644 --- a/src/astal-river.c +++ b/src/astal-river.c @@ -1,5 +1,6 @@ #include <getopt.h> #include <json-glib/json-glib.h> +#include <stdlib.h> #include "gio/gio.h" #include "river.h" @@ -33,7 +34,12 @@ int main(int argc, char** argv) { } } - AstalRiverRiver* river = astal_river_river_new(); + GError *error = NULL; + AstalRiverRiver* river = g_initable_new(ASTAL_RIVER_TYPE_RIVER, NULL, &error, NULL); + if(error) { + g_critical("%s\n", error->message); + exit(EXIT_FAILURE); + } if (daemon) { loop = g_main_loop_new(NULL, FALSE); g_signal_connect(river, "changed", G_CALLBACK(print_json), NULL); |