mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 10:11:41 -05:00
Attempt to fix access to a deleted item view.
This commit is contained in:
parent
42a7e86e51
commit
bb35d71fdc
3 changed files with 4 additions and 2 deletions
|
@ -268,7 +268,6 @@ void HistoryItem::refreshMainView() {
|
||||||
void HistoryItem::removeMainView() {
|
void HistoryItem::removeMainView() {
|
||||||
if (const auto view = mainView()) {
|
if (const auto view = mainView()) {
|
||||||
Auth().data().notifyHistoryChangeDelayed(_history);
|
Auth().data().notifyHistoryChangeDelayed(_history);
|
||||||
Auth().data().notifyViewRemoved(view);
|
|
||||||
view->removeFromBlock();
|
view->removeFromBlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,7 @@ public:
|
||||||
HistoryView::Element *mainView() const {
|
HistoryView::Element *mainView() const {
|
||||||
return _mainView;
|
return _mainView;
|
||||||
}
|
}
|
||||||
void setMainView(HistoryView::Element *view) {
|
void setMainView(not_null<HistoryView::Element*> view) {
|
||||||
_mainView = view;
|
_mainView = view;
|
||||||
}
|
}
|
||||||
void refreshMainView();
|
void refreshMainView();
|
||||||
|
|
|
@ -629,6 +629,9 @@ Element::~Element() {
|
||||||
if (_data->mainView() == this) {
|
if (_data->mainView() == this) {
|
||||||
_data->clearMainView();
|
_data->clearMainView();
|
||||||
}
|
}
|
||||||
|
if (_context == Context::History) {
|
||||||
|
Auth().data().notifyViewRemoved(this);
|
||||||
|
}
|
||||||
Auth().data().unregisterItemView(this);
|
Auth().data().unregisterItemView(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue