[network-manager-netbook/MplPanelClient] Fix warnings in device handler



commit 1bab88d827a799e395949369dd65c596c4cc26d7
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Sep 30 16:41:34 2009 +0100

    Fix warnings in device handler
    
    If we're going to unref device, we need to hold a reference to them.
    Also make sure we disconnect device_state_changed_id from the correct
    object.

 src/nmn-device-handler.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/nmn-device-handler.c b/src/nmn-device-handler.c
index 68be2ed..493aec8 100644
--- a/src/nmn-device-handler.c
+++ b/src/nmn-device-handler.c
@@ -163,7 +163,7 @@ nmn_device_handler_add_item (NmnDeviceHandler *self,
     g_signal_connect (item, "remove-requested", G_CALLBACK (item_removed), self);
 
     priv = GET_PRIVATE (self);
-    priv->items = g_slist_prepend (priv->items, item);
+    priv->items = g_slist_prepend (priv->items, g_object_ref (item));
     g_signal_emit (self, signals[ITEM_ADDED], 0, item);
 }
 
@@ -310,7 +310,7 @@ dispose (GObject *object)
     if (priv->disposed)
         return;
 
-    g_signal_handler_disconnect (settings, priv->device_state_changed_id);
+    g_signal_handler_disconnect (priv->device, priv->device_state_changed_id);
 
     settings = nmn_nm_data_get_user_settings (priv->nm_data);
     g_signal_handler_disconnect (settings, priv->connection_added_id);



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