[aravis] gv_interface: correctly use g_hash_table_replace.



commit ce5e741fe036f30a805ba63b20658291d8b35dd4
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Thu Nov 28 23:19:06 2013 +0100

    gv_interface: correctly use g_hash_table_replace.
    
    g_hash_table_insert removes the old value but not the old key, which is
    wrong in this case, as the key is stored in the value.

 src/arvgvinterface.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/arvgvinterface.c b/src/arvgvinterface.c
index 78f03c0..a81657b 100644
--- a/src/arvgvinterface.c
+++ b/src/arvgvinterface.c
@@ -333,16 +333,16 @@ arv_gv_interface_discover (ArvGvInterface *gv_interface)
 
                                                if (device_infos->name != NULL && device_infos->name[0] != 
'\0') {
                                                        arv_gv_interface_device_infos_ref (device_infos);
-                                                       g_hash_table_insert (gv_interface->priv->devices,
+                                                       g_hash_table_replace (gv_interface->priv->devices,
                                                                             device_infos->name, 
device_infos);
                                                }
                                                if (device_infos->user_name != NULL && 
device_infos->user_name[0] != '\0') {
                                                        arv_gv_interface_device_infos_ref (device_infos);
-                                                       g_hash_table_insert (gv_interface->priv->devices,
+                                                       g_hash_table_replace (gv_interface->priv->devices,
                                                                             device_infos->user_name, 
device_infos);
                                                }
                                                arv_gv_interface_device_infos_ref (device_infos);
-                                               g_hash_table_insert (gv_interface->priv->devices, 
device_infos->mac_string, device_infos);
+                                               g_hash_table_replace (gv_interface->priv->devices, 
device_infos->mac_string, device_infos);
 
                                                arv_gv_interface_device_infos_unref (device_infos);
                                        }


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