From aa4ce70d4b94598b0fda38b587bacc754cc656b7 Mon Sep 17 00:00:00 2001 From: Monsta Date: Wed, 28 Jan 2015 14:06:17 +0300 Subject: abort application when UI load fails some genius who programmed this decided it would be fine to access GtkBuilder variables after gtk_builder_add_from_file fails. thanks for the segfault, man. I've wasted an hour trying to find out what happens. Closes https://github.com/mate-desktop/mate-power-manager/pull/128 --- src/gpm-statistics.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/gpm-statistics.c') diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c index 795a372..423d4e1 100644 --- a/src/gpm-statistics.c +++ b/src/gpm-statistics.c @@ -1575,12 +1575,10 @@ main (int argc, char *argv[]) /* get UI */ builder = gtk_builder_new (); - retval = gtk_builder_add_from_file (builder, GPM_DATA "/gpm-statistics.ui", &error); - if (retval == 0) { - egg_warning ("failed to load ui: %s", error->message); - g_error_free (error); + if (error) { + egg_error ("failed to load ui: %s", error->message); } /* add history graph */ -- cgit v1.2.1