Commit 83e8d95a authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Catch another bad_weak_ptr exception

parent c6994469
......@@ -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;
}
......
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