2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Fix possible crash in views refresh.

This commit is contained in:
John Preston
2023-07-21 13:11:53 +04:00
parent 315b95a214
commit 2402285d03

View File

@@ -136,6 +136,8 @@ void RecentViews::show(RecentViewsData data) {
_data = data;
if (!_data.valid) {
_text = {};
_clickHandlerLifetime.destroy();
_userpicsLifetime.destroy();
_userpics = nullptr;
_widget = nullptr;
return;
@@ -305,6 +307,8 @@ void RecentViews::showMenu() {
_controller->setMenuShown(true);
_menu->setDestroyedCallback(crl::guard(_widget.get(), [=] {
_controller->setMenuShown(false);
_waitingForUserpicsLifetime.destroy();
_waitingForUserpics.clear();
_menuShortLifetime.destroy();
_menuEntries.clear();
_menuEntriesCount = 0;