diff --git a/coreapi/lsd.c b/coreapi/lsd.c index ddb8667c2..e216b8e88 100644 --- a/coreapi/lsd.c +++ b/coreapi/lsd.c @@ -285,5 +285,9 @@ MSSndCard *linphone_sound_daemon_get_proxy_card(LinphoneSoundDaemon *lsd){ } void linphone_core_use_sound_daemon(LinphoneCore *lc, LinphoneSoundDaemon *lsd){ - lc->sound_conf.lsd_card=linphone_sound_daemon_get_proxy_card (lsd); + if (lsd!=NULL){ + lc->sound_conf.lsd_card=linphone_sound_daemon_get_proxy_card (lsd); + }else { + lc->sound_conf.lsd_card=NULL; + } } diff --git a/coreapi/test_lsd.c b/coreapi/test_lsd.c index 930980f83..b34f51934 100644 --- a/coreapi/test_lsd.c +++ b/coreapi/test_lsd.c @@ -95,8 +95,9 @@ int main(int argc, char *argv[]){ wait_a_bit(lc,10); linphone_core_terminate_call(lc,NULL); } - - linphone_core_destroy(lc); + linphone_core_use_sound_daemon(lc,NULL); linphone_sound_daemon_destroy(lsd); + linphone_core_destroy(lc); + return 0; }