diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-05 21:17:14 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-05 21:17:14 +0200 |
commit | e8a59ef842a5c96823b3dcba30a97f861f5bfb75 (patch) | |
tree | 82af7ed526697463dfe197fd61822084a95d743f /Applications | |
parent | 244fe1089c1fec3b86e8cfe52a179a921373d3a1 (diff) | |
download | serenity-e8a59ef842a5c96823b3dcba30a97f861f5bfb75.zip |
DisplaySettings: Fix crash on exit (due to Core::Object on the stack)
Diffstat (limited to 'Applications')
-rw-r--r-- | Applications/DisplaySettings/DisplaySettings.h | 2 | ||||
-rw-r--r-- | Applications/DisplaySettings/main.cpp | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Applications/DisplaySettings/DisplaySettings.h b/Applications/DisplaySettings/DisplaySettings.h index d66fa6ff9c..fafd7adef9 100644 --- a/Applications/DisplaySettings/DisplaySettings.h +++ b/Applications/DisplaySettings/DisplaySettings.h @@ -31,7 +31,7 @@ #include <LibGUI/ComboBox.h> class DisplaySettingsWidget : public GUI::Widget { - C_OBJECT(MonitorWidget); + C_OBJECT(DisplaySettingsWidget); public: DisplaySettingsWidget(); diff --git a/Applications/DisplaySettings/main.cpp b/Applications/DisplaySettings/main.cpp index b321c1ce6a..f125f1afdc 100644 --- a/Applications/DisplaySettings/main.cpp +++ b/Applications/DisplaySettings/main.cpp @@ -50,14 +50,15 @@ int main(int argc, char** argv) return 1; } - DisplaySettingsWidget instance; + // FIXME: Clean up this bizarre object graph + auto instance = DisplaySettingsWidget::construct(); auto window = GUI::Window::construct(); window->set_title("Display settings"); window->move_to(100, 100); window->resize(360, 390); window->set_resizable(false); - window->set_main_widget(instance.root_widget()); + window->set_main_widget(instance->root_widget()); window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-display-settings.png")); auto menubar = GUI::MenuBar::construct(); |