Hanging on mutex in file chooser



I came across a bug where evince hangs when the file chooser dialog is dismissed.

I found a recent fix (from Matthias Clasen) in libgnomeui/filechooser/.gtkfilesystemgnomevfs.c which fixes part of the problem.

It seems to me that a similar change is required in gtk+/gtk/gtkfilesystemunix.c.

Padraig
--- gtkfilesystemunix.c.ORIG	Mon Sep  4 21:49:21 2006
+++ gtkfilesystemunix.c	Wed Sep 27 14:50:28 2006
@@ -255,6 +255,7 @@
 						   const char *mime_type);
 
 static gboolean execute_callbacks_idle (gpointer data);
+static void execute_callbacks (gpointer data);
 
 static gboolean fill_in_names     (GtkFileFolderUnix  *folder_unix,
 				   GError            **error);
@@ -443,7 +444,7 @@
       system_unix->execute_callbacks_idle_id = 0;
 
       /* call pending callbacks */
-      execute_callbacks_idle (system_unix);
+      execute_callbacks (system_unix);
     }
 
   G_OBJECT_CLASS (gtk_file_system_unix_parent_class)->dispose (object);
@@ -699,15 +700,13 @@
 
 
 
-static gboolean
-execute_callbacks_idle (gpointer data)
+static void
+execute_callbacks (gpointer data)
 {
   GSList *l;
   gboolean unref_file_system = TRUE;
   GtkFileSystemUnix *system_unix = GTK_FILE_SYSTEM_UNIX (data);
 
-  GDK_THREADS_ENTER ();
-
   if (!system_unix->execute_callbacks_idle_id)
     unref_file_system = FALSE;
   else
@@ -746,7 +745,15 @@
     g_object_unref (system_unix);
 
   system_unix->execute_callbacks_idle_id = 0;
+}
 
+static gboolean
+execute_callbacks_idle (gpointer data)
+{
+  GDK_THREADS_ENTER ();
+
+  execute_callbacks(data);
+
   GDK_THREADS_LEAVE ();
 
   return FALSE;


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