From de97cce689cb7214d7424c2a215693cef5f4b04a Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Tue, 13 Dec 2011 17:14:54 +0100 Subject: subscribe_cb: Check removed object to be known by us --- src/pa-sink-ctl.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/pa-sink-ctl.c b/src/pa-sink-ctl.c index c3ea04e..a8577f4 100644 --- a/src/pa-sink-ctl.c +++ b/src/pa-sink-ctl.c @@ -221,11 +221,15 @@ subscribe_cb(pa_context *c, pa_subscription_event_type_t t, switch (t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) { case PA_SUBSCRIPTION_EVENT_SINK: object = find_sink_by_idx(ctx, idx); + if (object == NULL) + break; ctx->sink_list = g_list_remove(ctx->sink_list, object); sink_free(object); break; case PA_SUBSCRIPTION_EVENT_SINK_INPUT: object = find_sink_input_by_idx(ctx, idx); + if (object == NULL) + break; ctx->input_list = g_list_remove(ctx->input_list, object); sink_input_free(object); -- cgit