Skip to content

Commit

Permalink
Fix possible crash in views refresh.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Jul 21, 2023
1 parent 315b95a commit 2402285
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ void RecentViews::show(RecentViewsData data) {
_data = data;
if (!_data.valid) {
_text = {};
_clickHandlerLifetime.destroy();
_userpicsLifetime.destroy();
_userpics = nullptr;
_widget = nullptr;
return;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2402285

Please sign in to comment.