mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-29 05:29:23 +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) {
|
if (_repliesRootId) {
|
||||||
controller()->sendingAnimation().clear();
|
controller()->sendingAnimation().clear();
|
||||||
}
|
}
|
||||||
if (_subsectionTabs) {
|
if (_subsectionTabs && !_subsectionTabs->dying()) {
|
||||||
_subsectionTabsLifetime.destroy();
|
_subsectionTabsLifetime.destroy();
|
||||||
controller()->saveSubsectionTabs(base::take(_subsectionTabs));
|
controller()->saveSubsectionTabs(base::take(_subsectionTabs));
|
||||||
}
|
}
|
||||||
|
@ -510,6 +510,10 @@ void SubsectionTabs::toggleModes() {
|
|||||||
_layoutRequests.fire({});
|
_layoutRequests.fire({});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SubsectionTabs::dying() const {
|
||||||
|
return !UsedFor(_history);
|
||||||
|
}
|
||||||
|
|
||||||
rpl::producer<> SubsectionTabs::removeRequests() const {
|
rpl::producer<> SubsectionTabs::removeRequests() const {
|
||||||
if (const auto forum = _history->peer->forum()) {
|
if (const auto forum = _history->peer->forum()) {
|
||||||
return forum->destroyed();
|
return forum->destroyed();
|
||||||
|
@ -49,6 +49,7 @@ public:
|
|||||||
|
|
||||||
[[nodiscard]] static bool UsedFor(not_null<Data::Thread*> thread);
|
[[nodiscard]] static bool UsedFor(not_null<Data::Thread*> thread);
|
||||||
|
|
||||||
|
[[nodiscard]] bool dying() const;
|
||||||
[[nodiscard]] rpl::producer<> removeRequests() const;
|
[[nodiscard]] rpl::producer<> removeRequests() const;
|
||||||
|
|
||||||
void extractToParent(not_null<Ui::RpWidget*> parent);
|
void extractToParent(not_null<Ui::RpWidget*> parent);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user