mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-03 20:46:28 +00:00
Catch another bad_weak_ptr exception
This commit is contained in:
parent
c699446974
commit
83e8d95af5
1 changed files with 5 additions and 4 deletions
|
|
@ -91,7 +91,6 @@ void ChatRoomPrivate::release () {
|
|||
msg->cancelFileTransfer();
|
||||
msg->getPrivate()->setChatRoom(nullptr);
|
||||
} catch(const std::bad_weak_ptr& e) {}
|
||||
|
||||
}
|
||||
for (auto &message : transientMessages) {
|
||||
message->cancelFileTransfer();
|
||||
|
|
@ -336,9 +335,11 @@ shared_ptr<ChatMessage> ChatRoomPrivate::getTransientMessage (unsigned int stora
|
|||
|
||||
std::shared_ptr<ChatMessage> ChatRoomPrivate::getWeakMessage (unsigned int storageId) const {
|
||||
for (auto &message : weakMessages) {
|
||||
shared_ptr<ChatMessage> msg(message);
|
||||
if (msg->getPrivate()->getStorageId() == storageId)
|
||||
return msg;
|
||||
try {
|
||||
shared_ptr<ChatMessage> msg(message);
|
||||
if (msg->getPrivate()->getStorageId() == storageId)
|
||||
return msg;
|
||||
} catch(const std::bad_weak_ptr& e) {}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue