Commit d2c788a0 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Fixed crash due to bad weak_ptr in ChatRoom

parent 655ce511
......@@ -88,9 +88,12 @@ void ChatRoomPrivate::release () {
isComposingHandler.stopTimers();
for (auto &message : weakMessages) {
shared_ptr<ChatMessage> msg(message);
msg->cancelFileTransfer();
msg->getPrivate()->setChatRoom(nullptr);
try {
shared_ptr<ChatMessage> msg(message);
msg->cancelFileTransfer();
msg->getPrivate()->setChatRoom(nullptr);
} catch(const std::bad_weak_ptr& e) {}
}
for (auto &message : transientMessages) {
message->cancelFileTransfer();
......
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