diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-11-06 21:58:54 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-11-06 21:58:54 +0100 |
commit | 8b952b387041341f556edcf0bb34576a2fc88568 (patch) | |
tree | 804b8976355ef3950628647370e7dfc1bdf96b4f /application/main.cpp | |
parent | 37cc59c04d0573a42d67242135495c0a0729f965 (diff) | |
download | MultiMC-8b952b387041341f556edcf0bb34576a2fc88568.tar MultiMC-8b952b387041341f556edcf0bb34576a2fc88568.tar.gz MultiMC-8b952b387041341f556edcf0bb34576a2fc88568.tar.lz MultiMC-8b952b387041341f556edcf0bb34576a2fc88568.tar.xz MultiMC-8b952b387041341f556edcf0bb34576a2fc88568.zip |
NOISSUE Refactor and sanitize MultiMC startup/shutdown
* Always create main window.
* Properly handle netowrk manager - it was created twice, leading to potential crashes.
Diffstat (limited to 'application/main.cpp')
-rw-r--r-- | application/main.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/application/main.cpp b/application/main.cpp index fde5eba7..5b557170 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -9,22 +9,23 @@ int main(int argc, char *argv[]) // initialize Qt MultiMC app(argc, argv); - Q_INIT_RESOURCE(instances); - Q_INIT_RESOURCE(multimc); - Q_INIT_RESOURCE(backgrounds); - Q_INIT_RESOURCE(versions); - - Q_INIT_RESOURCE(pe_dark); - Q_INIT_RESOURCE(pe_light); - Q_INIT_RESOURCE(pe_blue); - Q_INIT_RESOURCE(pe_colored); - Q_INIT_RESOURCE(OSX); - Q_INIT_RESOURCE(iOS); - switch (app.status()) { case MultiMC::Initialized: + { + Q_INIT_RESOURCE(instances); + Q_INIT_RESOURCE(multimc); + Q_INIT_RESOURCE(backgrounds); + Q_INIT_RESOURCE(versions); + + Q_INIT_RESOURCE(pe_dark); + Q_INIT_RESOURCE(pe_light); + Q_INIT_RESOURCE(pe_blue); + Q_INIT_RESOURCE(pe_colored); + Q_INIT_RESOURCE(OSX); + Q_INIT_RESOURCE(iOS); return app.exec(); + } case MultiMC::Failed: return 1; case MultiMC::Succeeded: |