diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 73a0b979d..03eca35c8 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -4249,6 +4249,7 @@ void linphone_call_handle_stream_events(LinphoneCall *call, int stream_index){ } else if (evt == ORTP_EVENT_RTT_CHARACTER_RECEIVED) { LinphoneChatRoom * chat_room = linphone_call_get_chat_room(call); linphone_core_real_time_text_received(call->core, chat_room, evd->info.received_rtt_character, call); + linphone_call_unref(chat_room->call); // linphone_call_get_chat_room(call) ref the call } ortp_event_destroy(ev); } diff --git a/tester/message_tester.c b/tester/message_tester.c index 2f2dd6b48..36ea7773e 100644 --- a/tester/message_tester.c +++ b/tester/message_tester.c @@ -1300,12 +1300,13 @@ static void real_time_text_message(void) { if (pauline_chat_room) { const char* message = "Lorem Ipsum Belledonnum Communicatum"; int i; - LinphoneChatMessage* rtt_message = linphone_chat_room_create_message(pauline_chat_room,NULL); + LinphoneChatMessage* rtt_message = linphone_chat_room_create_message(pauline_chat_room,NULL); + LinphoneChatRoom *marie_chat_room = linphone_call_get_chat_room(marie_call); for (i = 0; i < strlen(message); i++) { - linphone_chat_message_put_char(rtt_message,message[i]); + linphone_chat_message_put_char(rtt_message, message[i]); BC_ASSERT_TRUE(wait_for_until(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneIsComposingActiveReceived, i+1, 1000)); - BC_ASSERT_EQUAL(linphone_chat_room_get_char(linphone_call_get_chat_room(marie_call)), message[i], char, "%c"); + BC_ASSERT_EQUAL(linphone_chat_room_get_char(marie_chat_room), message[i], char, "%c"); } /*Commit the message, triggers a NEW LINE in T.140 */