mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-21 04:58:14 +00:00
fix(ChatMessage): avoid memory leak at destruction it it exists file content on one file transfer content
This commit is contained in:
parent
90d98d05dc
commit
c359665681
1 changed files with 7 additions and 2 deletions
|
|
@ -897,9 +897,14 @@ ChatMessage::ChatMessage (const shared_ptr<AbstractChatRoom> &chatRoom, ChatMess
|
|||
|
||||
ChatMessage::~ChatMessage () {
|
||||
L_D();
|
||||
|
||||
for (Content *content : d->contents)
|
||||
|
||||
for (Content *content : d->contents) {
|
||||
if (content->isFileTransfer()) {
|
||||
FileTransferContent *fileTransferContent = static_cast<FileTransferContent *>(content);
|
||||
delete fileTransferContent->getFileContent();
|
||||
}
|
||||
delete content;
|
||||
}
|
||||
|
||||
if (d->salOp) {
|
||||
d->salOp->set_user_pointer(nullptr);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue