Fixed crash when subscribing to a channel or service would fail

This commit is contained in:
John Törnblom 2012-03-10 12:14:26 +01:00
parent 47bc9b2d8f
commit 36af656f2e

View file

@ -376,11 +376,12 @@ http_stream_service(http_connection_t *hc, service_t *service)
pthread_mutex_unlock(&global_lock);
http_stream_run(hc, &sq, s);
pthread_mutex_lock(&global_lock);
subscription_unsubscribe(s);
pthread_mutex_unlock(&global_lock);
if(s) {
http_stream_run(hc, &sq, s);
pthread_mutex_lock(&global_lock);
subscription_unsubscribe(s);
pthread_mutex_unlock(&global_lock);
}
globalheaders_destroy(gh);
tsfix_destroy(tsfix);
@ -411,11 +412,12 @@ http_stream_channel(http_connection_t *hc, channel_t *ch)
0);
pthread_mutex_unlock(&global_lock);
http_stream_run(hc, &sq, s);
pthread_mutex_lock(&global_lock);
subscription_unsubscribe(s);
pthread_mutex_unlock(&global_lock);
if(s) {
http_stream_run(hc, &sq, s);
pthread_mutex_lock(&global_lock);
subscription_unsubscribe(s);
pthread_mutex_unlock(&global_lock);
}
globalheaders_destroy(gh);
tsfix_destroy(tsfix);