Browse Source

LibGUI: Fix crash in GAboutDialog::show()

It needed some updating to the new ref-counted CObject ways.
Andreas Kling 5 years ago
parent
commit
e38b454e11
1 changed files with 4 additions and 3 deletions
  1. 4 3
      Libraries/LibGUI/GAboutDialog.h

+ 4 - 3
Libraries/LibGUI/GAboutDialog.h

@@ -5,16 +5,17 @@
 class GAboutDialog final : public GDialog {
     C_OBJECT(GAboutDialog)
 public:
-    GAboutDialog(const StringView& name, const GraphicsBitmap* icon = nullptr, CObject* parent = nullptr);
     virtual ~GAboutDialog() override;
 
     static void show(const StringView& name, const GraphicsBitmap* icon = nullptr, CObject* parent = nullptr)
     {
-        GAboutDialog dialog(name, icon, parent);
-        dialog.exec();
+        auto dialog = GAboutDialog::construct(name, icon, parent);
+        dialog->exec();
     }
 
 private:
+    GAboutDialog(const StringView& name, const GraphicsBitmap* icon = nullptr, CObject* parent = nullptr);
+
     String m_name;
     RefPtr<GraphicsBitmap> m_icon;
 };