Fix crash clicking combobox scrollbar of dithering matrices in Dynamics popup (fix #2984)

We're trying to access the display() attribute of a kMouseDownMessage
message when the display was already deleted from Manager::_closeWindow.
This commit is contained in:
David Capello 2021-10-04 15:49:11 -03:00
parent f32393bb31
commit c1628e4c62

View File

@ -1172,13 +1172,19 @@ void Manager::removeMessagesForDisplay(Display* display)
ASSERT(manager_thread == base::this_thread::native_id());
#endif
for (Message* msg : msg_queue)
if (msg->display() == display)
for (Message* msg : msg_queue) {
if (msg->display() == display) {
msg->removeRecipient(msg->recipient());
msg->setDisplay(nullptr);
}
}
for (Message* msg : used_msg_queue)
if (msg->display() == display)
for (Message* msg : used_msg_queue) {
if (msg->display() == display) {
msg->removeRecipient(msg->recipient());
msg->setDisplay(nullptr);
}
}
}
void Manager::removePaintMessagesForDisplay(Display* display)