summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-07-05 21:17:14 +0200
committerAndreas Kling <kling@serenityos.org>2020-07-05 21:17:14 +0200
commite8a59ef842a5c96823b3dcba30a97f861f5bfb75 (patch)
tree82af7ed526697463dfe197fd61822084a95d743f /Applications
parent244fe1089c1fec3b86e8cfe52a179a921373d3a1 (diff)
downloadserenity-e8a59ef842a5c96823b3dcba30a97f861f5bfb75.zip
DisplaySettings: Fix crash on exit (due to Core::Object on the stack)
Diffstat (limited to 'Applications')
-rw-r--r--Applications/DisplaySettings/DisplaySettings.h2
-rw-r--r--Applications/DisplaySettings/main.cpp5
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();