summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/up-daemon.c4
-rw-r--r--src/up-device-list.c20
-rw-r--r--src/up-device-list.h3
3 files changed, 5 insertions, 22 deletions
diff --git a/src/up-daemon.c b/src/up-daemon.c
index cec1af7..c99da96 100644
--- a/src/up-daemon.c
+++ b/src/up-daemon.c
@@ -522,8 +522,8 @@ up_daemon_shutdown (UpDaemon *daemon)
/* stop accepting new devices and clear backend state */
up_backend_unplug (daemon->priv->backend);
- /* forget about discovered devices and release UpDaemon reference */
- up_device_list_clear (daemon->priv->power_devices, TRUE);
+ /* forget about discovered devices */
+ up_device_list_clear (daemon->priv->power_devices);
/* release UpDaemon reference */
g_object_run_dispose (G_OBJECT (daemon->priv->display_device));
diff --git a/src/up-device-list.c b/src/up-device-list.c
index d7250f5..35a9999 100644
--- a/src/up-device-list.c
+++ b/src/up-device-list.c
@@ -132,33 +132,17 @@ up_device_list_remove (UpDeviceList *list, gpointer device)
}
/**
- * up_device_list_remove_cb:
- **/
-static gboolean
-up_device_list_remove_all_cb (gpointer key, gpointer value, gpointer user_data)
-{
- return TRUE;
-}
-
-/**
* up_device_list_clear:
* @list: This class instance
- * @unref_it: %TRUE if you own a reference to the objects and want to drop it.
*
* Clear the contents of this list.
**/
void
-up_device_list_clear (UpDeviceList *list, gboolean unref_it)
+up_device_list_clear (UpDeviceList *list)
{
g_return_if_fail (UP_IS_DEVICE_LIST (list));
- /* caller owns these objects, but wants to destroy them */
- if (unref_it)
- g_ptr_array_foreach (list->priv->array, (GFunc) g_object_unref, NULL);
-
- /* remove all devices from the db */
- g_hash_table_foreach_remove (list->priv->map_native_path_to_device,
- up_device_list_remove_all_cb, NULL);
+ g_hash_table_remove_all (list->priv->map_native_path_to_device);
g_ptr_array_set_size (list->priv->array, 0);
}
diff --git a/src/up-device-list.h b/src/up-device-list.h
index 94eaa5a..ebd5d9b 100644
--- a/src/up-device-list.h
+++ b/src/up-device-list.h
@@ -59,8 +59,7 @@ gboolean up_device_list_insert (UpDeviceList *list,
gpointer device);
gboolean up_device_list_remove (UpDeviceList *list,
gpointer device);
-void up_device_list_clear (UpDeviceList *list,
- gboolean unref_it);
+void up_device_list_clear (UpDeviceList *list);
GPtrArray *up_device_list_get_array (UpDeviceList *list);
G_END_DECLS