[gnome-control-center/gnome-2-28] Calls gdk_threads_enter/leave without gdk_threads_init



commit ff7ed468834eee0d85c04822ddcff39037275b20
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Mar 10 12:18:52 2010 +0000

    Calls gdk_threads_enter/leave without gdk_threads_init
    
    Fix GTK+ multi-threading.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=610003

 capplets/appearance/appearance-main.c |    3 +++
 capplets/appearance/theme-installer.c |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/capplets/appearance/appearance-main.c b/capplets/appearance/appearance-main.c
index 081209a..6fa90c4 100644
--- a/capplets/appearance/appearance-main.c
+++ b/capplets/appearance/appearance-main.c
@@ -39,6 +39,8 @@ init_appearance_data (int *argc, char ***argv, GOptionContext *context)
   GError *err = NULL;
 
   g_thread_init (NULL);
+  gdk_threads_init ();
+  gdk_threads_enter ();
   theme_thumbnail_factory_init (*argc, *argv);
   capplet_init (context, argc, argv);
   activate_settings_daemon ();
@@ -209,6 +211,7 @@ main (int argc, char **argv)
 
   /* start the mainloop */
   gtk_main ();
+  gdk_threads_leave ();
 
   /* free stuff */
   g_free (data);
diff --git a/capplets/appearance/theme-installer.c b/capplets/appearance/theme-installer.c
index 6a90c16..d9df443 100644
--- a/capplets/appearance/theme-installer.c
+++ b/capplets/appearance/theme-installer.c
@@ -613,6 +613,7 @@ static void
 transfer_done_cb (GtkWidget *dialog,
 		  TransferData *tdata)
 {
+	gdk_threads_enter ();
 	/* XXX: path should be on the local filesystem by now? */
 
 	if (dialog != NULL) {
@@ -623,6 +624,8 @@ transfer_done_cb (GtkWidget *dialog,
 
 	g_free (tdata->path);
 	g_free (tdata);
+
+	gdk_threads_leave ();
 }
 
 void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]