mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibGUI: Don't use Core::Object::add() to instantiate dialogs
Now that add() returns a WidgetType&, we can't rely on the parent of a GUI::Dialog to still keep it alive after exec() returns. This happens because exec() will call remove_from_parent() on itself before returning. And so we go back to the old idiom for creating a GUI::Dialog centered above a specific window. Just call GUI::Dialog::construct(), passing the "parent" window as the last parameter.
This commit is contained in:
@@ -33,8 +33,8 @@
|
||||
|
||||
namespace GUI {
|
||||
|
||||
AboutDialog::AboutDialog(const StringView& name, const Gfx::Bitmap* icon, Core::Object* parent)
|
||||
: Dialog(parent)
|
||||
AboutDialog::AboutDialog(const StringView& name, const Gfx::Bitmap* icon, Window* parent_window)
|
||||
: Dialog(parent_window)
|
||||
, m_name(name)
|
||||
, m_icon(icon)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user