mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-22 02:07:24 +00:00
Fix crash in forum removal with new tabs.
This commit is contained in:
parent
96360619e1
commit
f9bf40a771
@ -456,7 +456,7 @@ ChatWidget::~ChatWidget() {
|
||||
if (_repliesRootId) {
|
||||
controller()->sendingAnimation().clear();
|
||||
}
|
||||
if (_subsectionTabs) {
|
||||
if (_subsectionTabs && !_subsectionTabs->dying()) {
|
||||
_subsectionTabsLifetime.destroy();
|
||||
controller()->saveSubsectionTabs(base::take(_subsectionTabs));
|
||||
}
|
||||
|
@ -510,6 +510,10 @@ void SubsectionTabs::toggleModes() {
|
||||
_layoutRequests.fire({});
|
||||
}
|
||||
|
||||
bool SubsectionTabs::dying() const {
|
||||
return !UsedFor(_history);
|
||||
}
|
||||
|
||||
rpl::producer<> SubsectionTabs::removeRequests() const {
|
||||
if (const auto forum = _history->peer->forum()) {
|
||||
return forum->destroyed();
|
||||
|
@ -49,6 +49,7 @@ public:
|
||||
|
||||
[[nodiscard]] static bool UsedFor(not_null<Data::Thread*> thread);
|
||||
|
||||
[[nodiscard]] bool dying() const;
|
||||
[[nodiscard]] rpl::producer<> removeRequests() const;
|
||||
|
||||
void extractToParent(not_null<Ui::RpWidget*> parent);
|
||||
|
Loading…
x
Reference in New Issue
Block a user