gvfs r1391 - in trunk: . daemon
- From: alexl svn gnome org
- To: svn-commits-list gnome org
- Subject: gvfs r1391 - in trunk: . daemon
- Date: Tue, 26 Feb 2008 11:25:56 +0000 (GMT)
Author: alexl
Date: Tue Feb 26 11:25:56 2008
New Revision: 1391
URL: http://svn.gnome.org/viewvc/gvfs?rev=1391&view=rev
Log:
2008-02-26 Alexander Larsson <alexl redhat com>
* daemon/gvfsjob.c:
(g_vfs_job_run):
(g_vfs_job_try):
Ref job while calling out.
* daemon/gvfsjobmount.c:
Own ref to backend while job is alive.
Modified:
trunk/ChangeLog
trunk/daemon/gvfsjob.c
trunk/daemon/gvfsjobmount.c
Modified: trunk/daemon/gvfsjob.c
==============================================================================
--- trunk/daemon/gvfsjob.c (original)
+++ trunk/daemon/gvfsjob.c Tue Feb 26 11:25:56 2008
@@ -188,7 +188,16 @@
GVfsJobClass *class;
class = G_VFS_JOB_GET_CLASS (job);
+
+ /* Ensure that the job lives durint the whole
+ * lifetime of the call, as it may disappear when
+ * we call g_vfs_job_succeed/fail()
+ */
+ g_object_ref (job);
+
class->run (job);
+
+ g_object_unref (job);
}
gboolean
@@ -197,7 +206,16 @@
GVfsJobClass *class;
class = G_VFS_JOB_GET_CLASS (job);
+
+ /* Ensure that the job lives durint the whole
+ * lifetime of the call, as it may disappear when
+ * we call g_vfs_job_succeed/fail()
+ */
+ g_object_ref (job);
+
return class->try (job);
+
+ g_object_unref (job);
}
void
Modified: trunk/daemon/gvfsjobmount.c
==============================================================================
--- trunk/daemon/gvfsjobmount.c (original)
+++ trunk/daemon/gvfsjobmount.c Tue Feb 26 11:25:56 2008
@@ -49,6 +49,7 @@
g_mount_spec_unref (job->mount_spec);
g_object_unref (job->mount_source);
+ g_object_unref (job->backend);
if (G_OBJECT_CLASS (g_vfs_job_mount_parent_class)->finalize)
(*G_OBJECT_CLASS (g_vfs_job_mount_parent_class)->finalize) (object);
@@ -86,7 +87,9 @@
job->mount_spec = g_mount_spec_ref (spec);
job->mount_source = g_object_ref (source);
job->is_automount = is_automount;
- job->backend = backend;
+ /* Ref the backend so we're sure its alive
+ during the whole job request. */
+ job->backend = g_object_ref (backend);
if (request)
job->request = dbus_message_ref (request);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]