From 6cc2bfad9e51f2abc9f53bd4c394f0b13fad7cf8 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 14 Jun 2010 12:06:58 +0200 Subject: [PATCH] fix crash at termination --- coreapi/lsd.c | 6 +++++- coreapi/test_lsd.c | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) 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; }