Fix possible crash.

This commit is contained in:
John Preston 2018-05-10 17:15:04 +03:00
parent bb6ab5314c
commit 96c0c30f7c
1 changed files with 3 additions and 1 deletions

View File

@ -1731,11 +1731,14 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re
_membersDropdown.destroy(); _membersDropdown.destroy();
_scrollToAnimation.finish(); _scrollToAnimation.finish();
_history = _migrated = nullptr; _history = _migrated = nullptr;
_list = nullptr;
_peer = nullptr; _peer = nullptr;
_channel = NoChannel; _channel = NoChannel;
_canSendMessages = false; _canSendMessages = false;
_silent.destroy(); _silent.destroy();
updateBotKeyboard(); updateBotKeyboard();
} else {
Assert(_list == nullptr);
} }
App::clearMousedItems(); App::clearMousedItems();
@ -1750,7 +1753,6 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re
_membersDropdownShowTimer.stop(); _membersDropdownShowTimer.stop();
_scroll->takeWidget<HistoryInner>().destroy(); _scroll->takeWidget<HistoryInner>().destroy();
_list = nullptr;
clearInlineBot(); clearInlineBot();