mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-19 03:58:08 +00:00
message_tester.c: abort test if message has not been received, fix crash and reformat it
This commit is contained in:
parent
ba100f073f
commit
24687ecbe9
3 changed files with 581 additions and 896 deletions
|
|
@ -137,7 +137,8 @@ static void _linphone_chat_room_destroy(LinphoneChatRoom *cr) {
|
|||
}
|
||||
|
||||
void linphone_chat_message_set_state(LinphoneChatMessage *msg, LinphoneChatMessageState state) {
|
||||
if (state != msg->state) {
|
||||
/* do not invoke callbacks on orphan messages */
|
||||
if (state != msg->state && msg->chat_room != NULL) {
|
||||
ms_message("Chat message %p: moving from state %s to %s", msg, linphone_chat_message_state_to_string(msg->state),
|
||||
linphone_chat_message_state_to_string(state));
|
||||
msg->state = state;
|
||||
|
|
@ -846,13 +847,13 @@ uint32_t linphone_chat_room_get_char(const LinphoneChatRoom *cr) {
|
|||
int linphone_chat_message_put_char(LinphoneChatMessage *msg, uint32_t charater) {
|
||||
LinphoneChatRoom *cr = linphone_chat_message_get_chat_room(msg);
|
||||
LinphoneCall *call = cr->call;
|
||||
|
||||
|
||||
if (!call || !call->textstream) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
text_stream_putchar32(call->textstream, charater);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
static int linphone_chat_room_stop_composing(void *data, unsigned int revents) {
|
||||
|
|
@ -1087,11 +1088,11 @@ void linphone_chat_message_unref(LinphoneChatMessage *msg) {
|
|||
}
|
||||
|
||||
static void linphone_chat_message_release(LinphoneChatMessage *msg) {
|
||||
/*mark the chat msg as orphan (it has no chat room anymore), and unref it*/
|
||||
msg->chat_room = NULL;
|
||||
if (msg->file_transfer_information != NULL) {
|
||||
linphone_chat_message_cancel_file_transfer(msg);
|
||||
}
|
||||
/*mark the chat msg as orphan (it has no chat room anymore), and unref it*/
|
||||
msg->chat_room = NULL;
|
||||
linphone_chat_message_unref(msg);
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -368,6 +368,9 @@ void linphone_core_manager_stop(LinphoneCoreManager *mgr){
|
|||
}
|
||||
|
||||
void linphone_core_manager_destroy(LinphoneCoreManager* mgr) {
|
||||
if (mgr->stat.last_received_chat_message) {
|
||||
linphone_chat_message_unref(mgr->stat.last_received_chat_message);
|
||||
}
|
||||
if (mgr->lc){
|
||||
const char *record_file=linphone_core_get_record_file(mgr->lc);
|
||||
int unterminated_calls;
|
||||
|
|
@ -385,8 +388,9 @@ void linphone_core_manager_destroy(LinphoneCoreManager* mgr) {
|
|||
}
|
||||
linphone_core_destroy(mgr->lc);
|
||||
}
|
||||
if (mgr->identity) linphone_address_destroy(mgr->identity);
|
||||
if (mgr->stat.last_received_chat_message) linphone_chat_message_unref(mgr->stat.last_received_chat_message);
|
||||
if (mgr->identity) {
|
||||
linphone_address_destroy(mgr->identity);
|
||||
}
|
||||
manager_count--;
|
||||
|
||||
ms_free(mgr);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue