2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 06:55:58 +00:00

Use shared_ptr<Memento> for sections.

This commit is contained in:
John Preston
2020-12-14 18:48:10 +04:00
parent baba7e272d
commit b6483cb65c
54 changed files with 147 additions and 152 deletions

View File

@@ -123,7 +123,7 @@ PollData *AbstractController::poll() const {
}
void AbstractController::showSection(
std::unique_ptr<Window::SectionMemento> &&memento,
std::shared_ptr<Window::SectionMemento> memento,
const Window::SectionShow &params) {
return parentController()->showSection(std::move(memento), params);
}
@@ -170,7 +170,7 @@ void Controller::setupMigrationViewer() {
const auto section = _section;
InvokeQueued(_widget, [=] {
window->showSection(
std::make_unique<Memento>(peer, section),
std::make_shared<Memento>(peer, section),
Window::SectionShow(
Window::SectionShow::Way::Backward,
anim::type::instant,
@@ -261,7 +261,7 @@ void Controller::saveSearchState(not_null<ContentMemento*> memento) {
}
void Controller::showSection(
std::unique_ptr<Window::SectionMemento> &&memento,
std::shared_ptr<Window::SectionMemento> memento,
const Window::SectionShow &params) {
if (!_widget->showInternal(memento.get(), params)) {
AbstractController::showSection(std::move(memento), params);