Commit 3abfd274 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Create a shared_ptr of ChatMessage in ChatRoom createMessage

parent 8167360f
......@@ -610,8 +610,8 @@ LinphoneChatMessage *ChatRoom::createFileTransferMessage (const LinphoneContent
}
LinphoneChatMessage *ChatRoom::createMessage (const string &message) {
ChatMessage chatMessage(static_pointer_cast<ChatRoom>(shared_from_this()));
LinphoneChatMessage *msg = chatMessage.getBackPtr();
shared_ptr<ChatMessage> chatMessage = make_shared<ChatMessage>(static_pointer_cast<ChatRoom>(shared_from_this()));
LinphoneChatMessage *msg = chatMessage->getBackPtr();
linphone_chat_message_set_chat_room(msg, GET_BACK_PTR(this));
linphone_chat_message_set_state(msg, LinphoneChatMessageStateIdle);
linphone_chat_message_set_text(msg, message.empty() ? nullptr : ms_strdup(message.c_str()));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment