From bddabad3d9c1dce986d9d71538ecd376bdb286a0 Mon Sep 17 00:00:00 2001 From: Brandon Scott Date: Wed, 23 Oct 2019 17:51:29 -0500 Subject: [PATCH] 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. --- Applications/HexEditor/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Applications/HexEditor/main.cpp b/Applications/HexEditor/main.cpp index f3d0a35eca..f540dcc5fd 100644 --- a/Applications/HexEditor/main.cpp +++ b/Applications/HexEditor/main.cpp @@ -18,11 +18,11 @@ int main(int argc, char** argv) return GWindow::CloseRequestDecision::StayOpen; }; - if (argc >= 2) - hex_editor_widget->open_file(argv[1]); - window->show(); window->set_icon(load_png("/res/icons/16x16/app-hexeditor.png")); + if (argc >= 2) + hex_editor_widget->open_file(argv[1]); + return app.exec(); }