[pulseaudio-discuss] [PATCH 04/13] device-port: Remove pa_device_port_hashmap_free()

Tanu Kaskinen tanuk at iki.fi
Tue Feb 12 11:36:54 PST 2013


---
 src/modules/bluetooth/module-bluetooth-device.c |    2 +-
 src/pulsecore/card.c                            |    4 ++--
 src/pulsecore/device-port.c                     |    6 ------
 src/pulsecore/device-port.h                     |    2 --
 src/pulsecore/sink.c                            |    4 ++--
 src/pulsecore/source.c                          |    4 ++--
 6 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 33b2afa..f6f6da6 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -2432,7 +2432,7 @@ static pa_hook_result_t uuid_added_cb(pa_bluetooth_discovery *y, const struct pa
 
     pa_card_add_ports(u->card, new_ports);
 
-    pa_device_port_hashmap_free(new_ports);
+    pa_hashmap_free(new_ports, (pa_free_cb_t) pa_device_port_unref);
 
     return PA_HOOK_OK;
 }
diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
index 560e36e..c3bb7eb 100644
--- a/src/pulsecore/card.c
+++ b/src/pulsecore/card.c
@@ -129,7 +129,7 @@ void pa_card_new_data_done(pa_card_new_data *data) {
         pa_hashmap_free(data->profiles, (pa_free_cb_t) pa_card_profile_free);
 
     if (data->ports)
-        pa_device_port_hashmap_free(data->ports);
+        pa_hashmap_free(data->ports, (pa_free_cb_t) pa_device_port_unref);
 
     pa_xfree(data->name);
     pa_xfree(data->active_profile);
@@ -237,7 +237,7 @@ void pa_card_free(pa_card *c) {
     pa_assert(pa_idxset_isempty(c->sources));
     pa_idxset_free(c->sources, NULL, NULL);
 
-    pa_device_port_hashmap_free(c->ports);
+    pa_hashmap_free(c->ports, (pa_free_cb_t) pa_device_port_unref);
 
     if (c->profiles)
         pa_hashmap_free(c->profiles, (pa_free_cb_t) pa_card_profile_free);
diff --git a/src/pulsecore/device-port.c b/src/pulsecore/device-port.c
index 5c7a5bb..e0f9560 100644
--- a/src/pulsecore/device-port.c
+++ b/src/pulsecore/device-port.c
@@ -89,12 +89,6 @@ pa_device_port *pa_device_port_new(pa_core *c, const char *name, const char *des
     return p;
 }
 
-void pa_device_port_hashmap_free(pa_hashmap *h) {
-    pa_assert(h);
-
-    pa_hashmap_free(h, (pa_free_cb_t) pa_device_port_unref);
-}
-
 void pa_device_port_set_latency_offset(pa_device_port *p, int64_t offset) {
     uint32_t state;
     pa_core *core;
diff --git a/src/pulsecore/device-port.h b/src/pulsecore/device-port.h
index cea00e6..40306f5 100644
--- a/src/pulsecore/device-port.h
+++ b/src/pulsecore/device-port.h
@@ -65,8 +65,6 @@ PA_DECLARE_PUBLIC_CLASS(pa_device_port);
 
 pa_device_port *pa_device_port_new(pa_core *c, const char *name, const char *description, size_t extra);
 
-void pa_device_port_hashmap_free(pa_hashmap *h);
-
 /* The port's available status has changed */
 void pa_device_port_set_available(pa_device_port *p, pa_port_available_t available);
 
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 5dd168c..5f625d6 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -141,7 +141,7 @@ void pa_sink_new_data_done(pa_sink_new_data *data) {
     pa_proplist_free(data->proplist);
 
     if (data->ports)
-        pa_device_port_hashmap_free(data->ports);
+        pa_hashmap_free(data->ports, (pa_free_cb_t) pa_device_port_unref);
 
     pa_xfree(data->name);
     pa_xfree(data->active_port);
@@ -742,7 +742,7 @@ static void sink_free(pa_object *o) {
         pa_proplist_free(s->proplist);
 
     if (s->ports)
-        pa_device_port_hashmap_free(s->ports);
+        pa_hashmap_free(s->ports, (pa_free_cb_t) pa_device_port_unref);
 
     pa_xfree(s);
 }
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 9915cea..960581c 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -133,7 +133,7 @@ void pa_source_new_data_done(pa_source_new_data *data) {
     pa_proplist_free(data->proplist);
 
     if (data->ports)
-        pa_device_port_hashmap_free(data->ports);
+        pa_hashmap_free(data->ports, (pa_free_cb_t) pa_device_port_unref);
 
     pa_xfree(data->name);
     pa_xfree(data->active_port);
@@ -672,7 +672,7 @@ static void source_free(pa_object *o) {
         pa_proplist_free(s->proplist);
 
     if (s->ports)
-        pa_device_port_hashmap_free(s->ports);
+        pa_hashmap_free(s->ports, (pa_free_cb_t) pa_device_port_unref);
 
     pa_xfree(s);
 }
-- 
1.7.10.4



More information about the pulseaudio-discuss mailing list