summaryrefslogtreecommitdiff
path: root/src/modules/module-suspend-on-idle.c
diff options
context:
space:
mode:
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>2014-03-26 17:39:48 +0200
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>2014-04-17 10:06:23 +0300
commiteca082a93f2619cfa10733947a81fa779cb49573 (patch)
treee97621d7180832fb493c219a3db044a25c11a89b /src/modules/module-suspend-on-idle.c
parent14e2553185e1afa93737586771326cd12a154239 (diff)
Use pa_hashmap_remove_and_free() where appropriate
Diffstat (limited to 'src/modules/module-suspend-on-idle.c')
-rw-r--r--src/modules/module-suspend-on-idle.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/modules/module-suspend-on-idle.c b/src/modules/module-suspend-on-idle.c
index 15cbf95f0..6fbe6406a 100644
--- a/src/modules/module-suspend-on-idle.c
+++ b/src/modules/module-suspend-on-idle.c
@@ -396,14 +396,11 @@ static void device_info_free(struct device_info *d) {
}
static pa_hook_result_t device_unlink_hook_cb(pa_core *c, pa_object *o, struct userdata *u) {
- struct device_info *d;
-
pa_assert(c);
pa_object_assert_ref(o);
pa_assert(u);
- if ((d = pa_hashmap_remove(u->device_infos, o)))
- device_info_free(d);
+ pa_hashmap_remove_and_free(u->device_infos, o);
return PA_HOOK_OK;
}