Added fix for --version segv

This commit is contained in:
Jesse van den Kieboom 2006-02-20 22:31:35 +00:00
parent 4b947dba10
commit da2347aeb6
1 changed files with 13 additions and 10 deletions

View File

@ -260,7 +260,7 @@ gm_app_load_worlds(GmApp *app, gboolean autoload) {
}
}
} else {
gm_debug_msg(DEBUG_ALWAYS, "Nee: %s", path);
gm_debug_msg(DEBUG_ALWAYS, "Directory can't be opened: %s", path);
}
g_free(path);
@ -436,15 +436,11 @@ gm_app_new(int argc, char *argv[]) {
g_thread_init(NULL);
gtk_set_locale();
gtk_init(&argc, &argv);
gnome_program_init(PACKAGE, VERSION, LIBGNOMEUI_MODULE,
argc, argv, GNOME_PARAM_POPT_TABLE, poptions,
GNOME_PARAM_APP_DATADIR, PACKAGE_DATA_DIR, NULL);
if (show_version) {
printf(_("Current version of GnoeMoe is %s\n"), VERSION);
return app;
}
app->priv->client = gnome_master_client();
gtk_signal_connect(GTK_OBJECT(app->priv->client), "save_yourself",
@ -455,10 +451,14 @@ gm_app_new(int argc, char *argv[]) {
/* Initialize everything */
gnome_vfs_init();
glade_init();
//mcp_init();
gm_pixbuf_init();
gm_app_initialize(app);
//editor_init();
if (show_version) {
g_object_unref(G_OBJECT(app));
printf(_("Current version of GnoeMoe is %s\n"), VERSION);
return NULL;
}
return app;
}
@ -546,9 +546,12 @@ int
main(int argc, char *argv[]) {
g_type_init();
application = gm_app_new(argc, argv);
gm_app_run(application);
g_object_unref(application);
if (application) {
gm_app_run(application);
g_object_unref(application);
}
return 0;
}