Tear down Layer Info instantly when its sublist dies

Task: 2026/08/21/resubscribe-info-wrap-teardown-on-replaced-sublist
This commit is contained in:
John Preston
2026-08-21 12:39:18 +04:00
committed by 23rd
parent c2c058517c
commit d139ca01de
2 changed files with 14 additions and 10 deletions

View File

@@ -169,15 +169,19 @@ void WrapWidget::subscribeToThreadDestroyed() {
sublist->destroyed(
) | rpl::on_next([=] {
const auto parent = _controller->parentController();
parent->hideSpecialLayer();
parent->showBackFromStack(
Window::SectionShow(
anim::type::instant,
anim::activation::background));
parent->clearSectionStack(Window::SectionShow(
Window::SectionShow::Way::ClearStack,
anim::type::instant));
_removeRequests.fire({});
if (_wrap.current() == Wrap::Layer) {
parent->hideSpecialLayer(anim::type::instant);
} else if (_wrap.current() == Wrap::Narrow) {
parent->showBackFromStack(
Window::SectionShow(
anim::type::instant,
anim::activation::background));
parent->clearSectionStack(Window::SectionShow(
Window::SectionShow::Way::ClearStack,
anim::type::instant));
} else {
_removeRequests.fire({});
}
}, _threadDestroyedLifetime);
}
}

View File

@@ -1 +1 @@
Info wrap `destroyed()` teardown now rebinds when `showNewContent` replaces the controller, using a wrap-owned lifetime so an old sublist cannot tear down a wrap that no longer shows it. The constructor path still subscribes.
Info wrap `destroyed()` teardown now rebinds when `showNewContent` replaces the controller, using a wrap-owned lifetime so an old sublist cannot tear down a wrap that no longer shows it. The constructor path still subscribes. Sublist teardown follows the topic wrap-kind split (Layer hide, Narrow back, else remove) with instant animation so a Layer wrap is gone before the sublist is erased.