From e14852711b3221ad1affdfd871513d79b83cc195 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 12 Nov 2015 12:22:49 +0100 Subject: [PATCH] fix crash in linphone_core_create_call_params(), try to workaround an sqlite problem on iOS --- coreapi/linphonecore.c | 6 +++++- coreapi/message_storage.c | 7 +++++++ mediastreamer2 | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 54e6e56de..160e0b3fe 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -6703,7 +6703,11 @@ static LinphoneCallParams *_create_call_params(LinphoneCore *lc){ */ LinphoneCallParams *linphone_core_create_call_params(LinphoneCore *lc, LinphoneCall *call){ if (!call) return _create_call_params(lc); - return linphone_call_params_copy(call->params); + if (call->params){ + return linphone_call_params_copy(call->params); + } + ms_error("linphone_core_create_call_params(): call [%p] is not in a state where call params can be created or used.", call); + return NULL; } const char *linphone_reason_to_string(LinphoneReason err){ diff --git a/coreapi/message_storage.c b/coreapi/message_storage.c index f1730e925..aae1d8756 100644 --- a/coreapi/message_storage.c +++ b/coreapi/message_storage.c @@ -640,6 +640,13 @@ static int _linphone_sqlite3_open(const char *db_file, sqlite3 **db) { ms_error("Cannot set sqlite3 temporary store to memory: %s.", errmsg); sqlite3_free(errmsg); } +#if TARGET_OS_IPHONE + ret = sqlite3_exec(*db, "PRAGMA journal_mode = OFF", NULL, NULL, &errmsg); + if (ret != SQLITE_OK) { + ms_error("Cannot set sqlite3 journal_mode to off: %s.", errmsg); + sqlite3_free(errmsg); + } +#endif return ret; } diff --git a/mediastreamer2 b/mediastreamer2 index cdd6eb1f2..c04a7920a 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit cdd6eb1f2684982f01a9650e8a3fe6c89011d156 +Subproject commit c04a7920a4d4a2c72d189cef6f20b1b91251e645