[gnome-disk-utility] Nautilus extension: ref and unref objects correctly



commit 4159125a00290cb073365c6c3f2e365d49bb5f6f
Author: Tomas Bzatek <tbzatek redhat com>
Date:   Tue Oct 13 16:48:59 2009 +0200

    Nautilus extension: ref and unref objects correctly
    
    Save reference to device as long as the menu item lives.
    This caused random Nautilus crashes on device removal.

 src/nautilus-extension/nautilus-gdu.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-extension/nautilus-gdu.c b/src/nautilus-extension/nautilus-gdu.c
index 8f69bda..196431f 100644
--- a/src/nautilus-extension/nautilus-gdu.c
+++ b/src/nautilus-extension/nautilus-gdu.c
@@ -227,8 +227,8 @@ nautilus_gdu_get_file_items (NautilusMenuProvider *provider,
                                        "nautilus-gdu");
         g_object_set_data_full (G_OBJECT (item),
                                 "gdu-device",
-                                device,
-                                (GDestroyNotify) g_object_ref);
+                                g_object_ref (device),
+                                (GDestroyNotify) g_object_unref);
         g_object_set_data_full (G_OBJECT (item),
                                 "nautilus-file",
                                 g_object_ref (nautilus_file),



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