LibGUI: Fix crash in GAboutDialog::show()

It needed some updating to the new ref-counted CObject ways.
This commit is contained in:
Andreas Kling 2019-09-29 20:37:02 +02:00
parent 61bc597b2d
commit e38b454e11
Notes: sideshowbarker 2024-07-19 11:53:03 +09:00

View file

@ -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;
};