diff --git a/Telegram/SourceFiles/window/themes/window_theme_editor.cpp b/Telegram/SourceFiles/window/themes/window_theme_editor.cpp index 3530ee2ba..efeb5cf09 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_editor.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_editor.cpp @@ -702,20 +702,20 @@ void Editor::showMenu() { if (_menu) { return; } - _menu.create(this); - _menu->setHiddenCallback([weak = Ui::MakeWeak(this), menu = _menu.data()]{ + _menu = base::make_unique_q(this); + _menu->setHiddenCallback([weak = Ui::MakeWeak(this), menu = _menu.get()]{ menu->deleteLater(); if (weak && weak->_menu == menu) { weak->_menu = nullptr; weak->_menuToggle->setForceRippled(false); } }); - _menu->setShowStartCallback(crl::guard(this, [this, menu = _menu.data()]{ + _menu->setShowStartCallback(crl::guard(this, [this, menu = _menu.get()]{ if (_menu == menu) { _menuToggle->setForceRippled(true); } })); - _menu->setHideStartCallback(crl::guard(this, [this, menu = _menu.data()]{ + _menu->setHideStartCallback(crl::guard(this, [this, menu = _menu.get()]{ if (_menu == menu) { _menuToggle->setForceRippled(false); } diff --git a/Telegram/SourceFiles/window/themes/window_theme_editor.h b/Telegram/SourceFiles/window/themes/window_theme_editor.h index b8e459888..4daf7473b 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_editor.h +++ b/Telegram/SourceFiles/window/themes/window_theme_editor.h @@ -80,7 +80,7 @@ private: QPointer _inner; object_ptr _close; object_ptr _menuToggle; - object_ptr _menu = { nullptr }; + base::unique_qptr _menu; object_ptr _select; object_ptr _leftShadow; object_ptr _topShadow;