[Goodies-commits] r5034 - thunar-svn-plugin/trunk/tsp-svn-helper

Peter de Ridder peter at xfce.org
Tue Jul 8 22:24:24 CEST 2008


Author: peter
Date: 2008-07-08 20:24:24 +0000 (Tue, 08 Jul 2008)
New Revision: 5034

Modified:
   thunar-svn-plugin/trunk/tsp-svn-helper/main.c
Log:
fix bug #4169
gdk_threads_enter directly behind gdk_threads_init

Modified: thunar-svn-plugin/trunk/tsp-svn-helper/main.c
===================================================================
--- thunar-svn-plugin/trunk/tsp-svn-helper/main.c	2008-07-08 16:42:12 UTC (rev 5033)
+++ thunar-svn-plugin/trunk/tsp-svn-helper/main.c	2008-07-08 20:24:24 UTC (rev 5034)
@@ -95,6 +95,9 @@
 	gchar **files = NULL;
 	GError *error = NULL;
 
+	GOptionGroup *option_group;
+	GOptionContext *option_context;
+
 	GOptionEntry general_options_table[] =
 	{
 		{ "version", 'v', 0, G_OPTION_ARG_NONE, &print_version, N_("Print version information"), NULL },
@@ -222,9 +225,13 @@
 		{ NULL, '\0', 0, 0, NULL, NULL, NULL }
 	};
 
-	GOptionGroup *option_group;
-	GOptionContext *option_context = g_option_context_new("<action> [options] [args]");
+  if (!g_thread_supported ())
+    g_thread_init (NULL);
+	gdk_threads_init ();
+  gdk_threads_enter ();
 
+	option_context = g_option_context_new("<action> [options] [args]");
+
 	g_option_context_add_main_entries(option_context, general_options_table, GETTEXT_PACKAGE);
 	g_option_context_add_group(option_context, gtk_get_option_group(TRUE));
 
@@ -308,9 +315,6 @@
 	g_option_group_add_entries(option_group, update_options_table);
 	g_option_context_add_group(option_context, option_group);
 
-	g_thread_init (NULL);
-	gdk_threads_init ();
-
 	if(!g_option_context_parse(option_context, &argc, &argv, &error))
 	{
 		g_fprintf(stderr, "%s: %s\n\tTry --help-all\n", g_get_prgname(), error->message);
@@ -465,6 +469,8 @@
 
 	svn_pool_destroy(pool);
 
+  gdk_threads_leave ();
+
 	return EXIT_SUCCESS;
 }
 




More information about the Goodies-commits mailing list