From 1e8514a2581ee8a0f30e728b51c2da2011910d6c Mon Sep 17 00:00:00 2001 From: Thomas Wood Date: Sun, 7 Jan 2007 15:47:51 +0000 Subject: [PATCH] Applied modified patch from bug 167063 (themus-theme-applier crashes while 2007-01-07 Thomas Wood * themus-theme-applier.c: (main): Applied modified patch from bug 167063 (themus-theme-applier crashes while running from command promt) svn path=/trunk/; revision=7083 --- vfs-methods/themus/ChangeLog | 5 +++++ vfs-methods/themus/themus-theme-applier.c | 22 ++++++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/vfs-methods/themus/ChangeLog b/vfs-methods/themus/ChangeLog index 1d2f974b9..2bd2529b4 100644 --- a/vfs-methods/themus/ChangeLog +++ b/vfs-methods/themus/ChangeLog @@ -1,3 +1,8 @@ +2007-01-07 Thomas Wood + + * themus-theme-applier.c: (main): Applied modified patch from bug 167063 + (themus-theme-applier crashes while running from command promt) + 2006-07-23 Sebastien Bacher * theme-method.directory.in: add encoding key, diff --git a/vfs-methods/themus/themus-theme-applier.c b/vfs-methods/themus/themus-theme-applier.c index b6a6fe563..dc4fc4bf9 100644 --- a/vfs-methods/themus/themus-theme-applier.c +++ b/vfs-methods/themus/themus-theme-applier.c @@ -35,7 +35,7 @@ int main (int argc, char **argv) { GnomeVFSURI *uri; GnomeThemeMetaInfo *theme; - GnomeProgram *program; + GnomeProgram *program = NULL; GladeXML *font_xml; GtkWidget *font_dialog; GtkWidget *font_sample; @@ -56,12 +56,21 @@ int main (int argc, char **argv) gnome_theme_init (NULL); uri = gnome_vfs_uri_new (args[0]); - g_assert (uri != NULL); - + + if (!uri) + { + g_object_unref (program); + return 1; + } + theme = gnome_theme_read_meta_theme (uri); gnome_vfs_uri_unref (uri); - - g_assert (theme != NULL); + + if (!theme) + { + g_object_unref (program); + return 1; + } if (theme->application_font) { glade_init (); @@ -94,6 +103,7 @@ int main (int argc, char **argv) gconf_client_set_string (client, FONT_KEY, theme->application_font, NULL); g_object_unref (client); } - + + g_free (program); return 0; }