[gvfs] udisks2: don't use object after unref
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] udisks2: don't use object after unref
- Date: Thu, 26 Jul 2012 16:10:51 +0000 (UTC)
commit 5b09d7e4176998c642e7fdfec71c3c35993a01b2
Author: David Zeuthen <zeuthen gmail com>
Date: Thu Jul 26 12:09:32 2012 -0400
udisks2: don't use object after unref
Technically there's no problem here since UDisksClient still has a
reference but it's pretty confusing. Fix it up by using
g_clear_object().
Signed-off-by: David Zeuthen <zeuthen gmail com>
monitor/udisks2/gvfsudisks2volumemonitor.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/monitor/udisks2/gvfsudisks2volumemonitor.c b/monitor/udisks2/gvfsudisks2volumemonitor.c
index 3e28579..3052beb 100644
--- a/monitor/udisks2/gvfsudisks2volumemonitor.c
+++ b/monitor/udisks2/gvfsudisks2volumemonitor.c
@@ -818,7 +818,7 @@ should_include_volume (GVfsUDisks2VolumeMonitor *monitor,
UDisksFilesystem *filesystem;
UDisksDrive *udisks_drive = NULL;
const gchar* const *mount_points;
- UDisksLoop *loop;
+ UDisksLoop *loop = NULL;
/* Block:Ignore trumps everything */
if (udisks_block_get_hint_ignore (block))
@@ -903,7 +903,6 @@ should_include_volume (GVfsUDisks2VolumeMonitor *monitor,
guint setup_by_uid;
setup_by_uid = udisks_loop_get_setup_by_uid (loop);
- g_object_unref (loop);
if (setup_by_uid != 0 && setup_by_uid != getuid ())
goto out;
@@ -928,6 +927,7 @@ should_include_volume (GVfsUDisks2VolumeMonitor *monitor,
out:
g_clear_object (&udisks_drive);
+ g_clear_object (&loop);
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]