Skip to content

Commit bddabad

Browse files
xeonsawesomekling
authored andcommitted
HexEditor: Fixed startup error
When attempting to open a file that doesnt exist or has permission problems, the application would end after hitting OK on the message box instead of starting up to an empty editor. I believe this has something to do with the dialog event loop interfering with the application event loop, or possibly the fact that the window creation code is in the show() method. To work around this I now call the open_file() method after the show() method.
1 parent e3fbd2f commit bddabad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Applications/HexEditor/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ int main(int argc, char** argv)
1818
return GWindow::CloseRequestDecision::StayOpen;
1919
};
2020

21-
if (argc >= 2)
22-
hex_editor_widget->open_file(argv[1]);
23-
2421
window->show();
2522
window->set_icon(load_png("/res/icons/16x16/app-hexeditor.png"));
2623

24+
if (argc >= 2)
25+
hex_editor_widget->open_file(argv[1]);
26+
2727
return app.exec();
2828
}

0 commit comments

Comments
 (0)