summaryrefslogtreecommitdiff
path: root/games-misc/solarus-quest-editor/files/solarus-quest-editor-1.6.5-fix-segfault.patch
blob: 1e2f1582e2cea1c345f48a6793f1ab8ed54000eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Solarus quest editor will segfault on startup with -O2

See: https://gitlab.com/solarus-games/solarus-quest-editor/-/commit/921ac6170a08dcfe601c7a11ee9f7c85386a4f3f
--- a/src/widgets/main_window.cpp
+++ b/src/widgets/main_window.cpp
@@ -1287,7 +1287,6 @@ void MainWindow::current_editor_changed(int index) {
 
   Editor* editor = get_current_editor();
   const bool has_editor = editor != nullptr;
-  ViewSettings& view_settings = editor->get_view_settings();
 
   // Set up toolbar buttons for this editor.
   ui.action_cut->setEnabled(has_editor);
@@ -1343,6 +1342,8 @@ void MainWindow::current_editor_changed(int index) {
 
   if (has_editor) {
 
+    ViewSettings& view_settings = editor->get_view_settings();
+
     connect(&view_settings, &ViewSettings::zoom_changed,
             this, &MainWindow::update_zoom);
     update_zoom();