Fix crash in notifications.

~HistoryItem() sometimes causes a queued notification to show.
Custom notifications depend on MainWindow and it is destroyed
already in clearHistories(), so clear the notifications queue first.
This commit is contained in:
John Preston 2017-03-12 11:49:44 +03:00
parent bc254228c9
commit 1395237810

View File

@ -2319,6 +2319,11 @@ namespace {
ClickHandler::clearActive();
ClickHandler::unpressed();
if (AuthSession::Exists()) {
// Clear notifications to prevent any showNotification() calls while destroying items.
AuthSession::Current().notifications()->clearAllFast();
}
histories().clear();
clearStorageImages();