[gvfs/gnome-3-2] daemon: Grab a pointer to the GvfsBackend before unref'ing a job source, preventing a crash.



commit 98d2e292807cd59aaae267a0e6aecfb0a0689e1e
Author: Michael Terry <michael terry canonical com>
Date:   Thu Sep 29 17:57:32 2011 +0200

    daemon: Grab a pointer to the GvfsBackend before unref'ing a job source, preventing a crash.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=654999

 daemon/gvfsjobunmount.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gvfsjobunmount.c b/daemon/gvfsjobunmount.c
index c4fadbc..d31b36e 100644
--- a/daemon/gvfsjobunmount.c
+++ b/daemon/gvfsjobunmount.c
@@ -231,6 +231,7 @@ unregister_mount_callback (DBusMessage *unmount_reply,
 			   gpointer user_data)
 {
   GVfsBackend *backend;
+  GVfsDaemon *daemon;
   GVfsJobUnmount *op_job = G_VFS_JOB_UNMOUNT (user_data);
 
   g_debug ("unregister_mount_callback, unmount_reply: %p, error: %p\n", unmount_reply, error);
@@ -239,9 +240,10 @@ unregister_mount_callback (DBusMessage *unmount_reply,
   (*G_VFS_JOB_CLASS (g_vfs_job_unmount_parent_class)->send_reply) (G_VFS_JOB (op_job));
 
   /* Unlink job source from daemon */
+  daemon = g_vfs_backend_get_daemon (backend);
   g_vfs_job_source_closed (G_VFS_JOB_SOURCE (backend));
 
-  g_vfs_daemon_close_active_channels (g_vfs_backend_get_daemon ((backend)));
+  g_vfs_daemon_close_active_channels (daemon);
 }
 
 /* Might be called on an i/o thread */



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