Destroy old info button in top bar widget.

Fixes #4503.
This commit is contained in:
John Preston 2018-03-15 18:22:55 +03:00
parent 9dc48522d8
commit 0d415837a0

View File

@ -386,8 +386,10 @@ void TopBarWidget::refreshInfoButton() {
Ui::UserpicButton::Role::Custom,
st::topBarInfoButton);
info->showSavedMessagesOnSelf(true);
_info.destroy();
_info = std::move(info);
} else if (const auto feed = _activeChat.feed()) {
_info.destroy();
_info = object_ptr<Ui::FeedUserpicButton>(
this,
_controller,