From: Jaroslav Kysela Date: Tue, 17 Mar 2015 13:08:26 +0000 (+0100) Subject: subscriptions: Fix crash when subscription is in the remove queue list, but unsubscri... X-Git-Tag: v4.1~266 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e16a5ca3d1c24e06b17ec1391faa3fe0fb02a23f;p=thirdparty%2Ftvheadend.git subscriptions: Fix crash when subscription is in the remove queue list, but unsubscribed before --- diff --git a/src/subscriptions.c b/src/subscriptions.c index 8af33476a..40aaa6bef 100644 --- a/src/subscriptions.c +++ b/src/subscriptions.c @@ -336,10 +336,8 @@ subscription_reschedule(void) subscription_show_info(s); } - while ((s = LIST_FIRST(&subscriptions_remove))) { - LIST_REMOVE(s, ths_remove_link); + while ((s = LIST_FIRST(&subscriptions_remove))) subscription_unsubscribe(s, 0); - } if (postpone <= 0 || postpone == INT_MAX) postpone = 2; @@ -513,6 +511,7 @@ subscription_unsubscribe(th_subscription_t *s, int quiet) service_instance_list_clear(&s->ths_instances); LIST_REMOVE(s, ths_global_link); + LIST_SAFE_REMOVE(s, ths_remove_link); #if ENABLE_MPEGTS if (s->ths_raw_service)