From b0349952fee08c345b0cc873be36026480b18e09 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 6 Nov 2017 17:52:55 +0100 Subject: [PATCH] Fix linphone_chat_room_create_message(). --- src/c-wrapper/api/c-chat-room.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/c-wrapper/api/c-chat-room.cpp b/src/c-wrapper/api/c-chat-room.cpp index ad3447da1..0717bee48 100644 --- a/src/c-wrapper/api/c-chat-room.cpp +++ b/src/c-wrapper/api/c-chat-room.cpp @@ -101,7 +101,10 @@ const LinphoneAddress *linphone_chat_room_get_peer_address (LinphoneChatRoom *cr } LinphoneChatMessage *linphone_chat_room_create_message (LinphoneChatRoom *cr, const char *message) { - return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(cr)->createMessage(L_C_TO_STRING(message))); + shared_ptr cppPtr = L_GET_CPP_PTR_FROM_C_OBJECT(cr)->createMessage(L_C_TO_STRING(message)); + LinphoneChatMessage *object = L_INIT(ChatMessage); + L_SET_CPP_PTR_FROM_C_OBJECT(object, cppPtr); + return object; } LinphoneChatMessage *linphone_chat_room_create_message_2 (