summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-12-13 22:21:35 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-12-13 22:21:35 +0100
commit8e75563bbf40f7c5fafe6c8283a9ca18dbe2d317 (patch)
tree67412536728b2e833ca03b55d17a29b83aff8574 /src
parent0fbc1eb45cc1a11191e5bdcee23119b40ce644f4 (diff)
downloadpa-sink-ctl-8e75563bbf40f7c5fafe6c8283a9ca18dbe2d317.tar.gz
pa-sink-ctl-8e75563bbf40f7c5fafe6c8283a9ca18dbe2d317.tar.bz2
pa-sink-ctl-8e75563bbf40f7c5fafe6c8283a9ca18dbe2d317.zip
Free old members when updating sinks/inputs
Diffstat (limited to 'src')
-rw-r--r--src/pa-sink-ctl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/pa-sink-ctl.c b/src/pa-sink-ctl.c
index 36ca388..5d336d4 100644
--- a/src/pa-sink-ctl.c
+++ b/src/pa-sink-ctl.c
@@ -88,9 +88,10 @@ sink_input_info_cb(pa_context *c, const pa_sink_input_info *i,
};
struct sink_input_info *inlist = find_sink_input_by_idx(ctx, i->index);
- if (inlist)
+ if (inlist) {
+ g_free(inlist->name);
*inlist = sink_input;
- else
+ } else
list_append_struct(ctx->input_list, sink_input);
}
@@ -167,9 +168,10 @@ sink_info_cb(pa_context *c, const pa_sink_info *i,
};
struct sink_info *inlist = find_sink_by_idx(ctx, i->index);
- if (inlist)
+ if (inlist) {
+ g_free(inlist->name);
*inlist = sink;
- else
+ } else
ctx->sink_list =
g_list_insert_sorted(ctx->sink_list,
g_memdup(&sink, sizeof sink),