diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-01-20 03:24:40 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-01-20 03:24:40 +0100 |
commit | 7aa7a7b6ac39371bbc7cd46ddf5d50ffd6e2a965 (patch) | |
tree | a2cbc687a5116a1cc440d0bfe25069dc006cd248 | |
parent | 936862362c30c22f42f33bd717b5f915f9c04657 (diff) |
fix destruction when no profiles are defined
-rw-r--r-- | src/pulsecore/card.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c index ec4a50c5..8e29f0a5 100644 --- a/src/pulsecore/card.c +++ b/src/pulsecore/card.c @@ -165,10 +165,12 @@ void pa_card_free(pa_card *c) { pa_assert(pa_idxset_isempty(c->sources)); pa_idxset_free(c->sources, NULL, NULL); - while ((profile = pa_hashmap_steal_first(c->profiles))) - pa_card_profile_free(profile); + if (c->profiles) { + while ((profile = pa_hashmap_steal_first(c->profiles))) + pa_card_profile_free(profile); - pa_hashmap_free(c->profiles, NULL, NULL); + pa_hashmap_free(c->profiles, NULL, NULL); + } pa_proplist_free(c->proplist); pa_xfree(c->driver); |