gvfs r2339 - in trunk: . monitor/proxy



Author: alexl
Date: Tue Mar 17 16:32:49 2009
New Revision: 2339
URL: http://svn.gnome.org/viewvc/gvfs?rev=2339&view=rev

Log:
2009-03-17  Alexander Larsson  <alexl redhat com>

        * monitor/proxy/gproxyshadowmount.c:
        (g_proxy_shadow_mount_remove):
	Don't unref the real mount directly when we're unshadowed, because
	that means most functions in the shadow mount won't work in the
	removed signal emissions.
	This caused lots of spew in e.g. gvfs-mount -oi on unmount of
	a shadowed mount.



Modified:
   trunk/ChangeLog
   trunk/monitor/proxy/gproxyshadowmount.c

Modified: trunk/monitor/proxy/gproxyshadowmount.c
==============================================================================
--- trunk/monitor/proxy/gproxyshadowmount.c	(original)
+++ trunk/monitor/proxy/gproxyshadowmount.c	Tue Mar 17 16:32:49 2009
@@ -49,6 +49,7 @@
 
   GProxyVolume *volume;
   GMount *real_mount;
+  gboolean real_mount_shadowed;
   GFile *root;
 };
 
@@ -73,6 +74,12 @@
 
   g_proxy_shadow_mount_remove (mount);
 
+  if (mount->real_mount != NULL)
+    {
+      g_object_unref (mount->real_mount);
+      mount->real_mount = NULL;
+    }
+  
   if (mount->volume_monitor != NULL)
     g_object_unref (mount->volume_monitor);
 
@@ -107,13 +114,12 @@
 void
 g_proxy_shadow_mount_remove (GProxyShadowMount *mount)
 {
-  if (mount->real_mount != NULL)
+  if (mount->real_mount_shadowed)
     {
       g_mount_unshadow (mount->real_mount);
       signal_emit_in_idle (mount->real_mount, "changed", NULL);
       signal_emit_in_idle (mount->volume_monitor, "mount-changed", mount->real_mount);
-      g_object_unref (mount->real_mount);
-      mount->real_mount = NULL;
+      mount->real_mount_shadowed = FALSE;
     }
 }
 
@@ -138,6 +144,7 @@
   mount->volume_monitor = g_object_ref (volume_monitor);
   mount->volume = g_object_ref (volume);
   mount->real_mount = g_object_ref (real_mount);
+  mount->real_mount_shadowed = TRUE;
   mount->root = activation_root;
 
   g_mount_shadow (mount->real_mount);



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