diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp index 117419c568..734108fd58 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp @@ -616,11 +616,11 @@ void EditPeerTypeBox::setInnerFocus() { void EditPeerTypeBox::prepare() { _peer->updateFull(); - const auto content = Ui::CreateChild(this); + auto content = object_ptr(this); const auto controller = Ui::CreateChild( this, - content, + content.data(), _peer, _useLocationPhrases, _privacySavedValue, @@ -657,5 +657,6 @@ void EditPeerTypeBox::prepare() { } addButton(tr::lng_cancel(), [=] { closeBox(); }); - setDimensionsToContent(st::boxWideWidth, content); + setDimensionsToContent(st::boxWideWidth, content.data()); + setInnerWidget(std::move(content)); }