diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2021-02-13 07:54:05 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2021-02-13 07:54:05 -0500 |
| commit | 406d6f28c0ee0e6d6187a0d633f3db07fab57841 (patch) | |
| tree | a40a33911362b0f5de412b77b8bf23d245df1565 /src/main.cpp | |
| parent | ee4c364ccc6c5fbd81b5136e75005d8b9550ca43 (diff) | |
force instance selection when the current instance cannot be used
the problem is that an empty instance name means the portable instance, but MO clears the name when it needs instance selection, which can create a loop if the portable instance can't be used
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 60d99817..84db88cb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -80,7 +80,8 @@ int run(int argc, char *argv[]) // stuff that's done only once, even if MO restarts in the loop below app.firstTimeSetup(multiProcess); - // force the "Select instance" dialog on startup (only for first loop) + // force the "Select instance" dialog on startup, only for first loop or when + // the current instance cannot be used bool pick = cl.pick(); // MO runs in a loop because it can be restarted in several ways, such as @@ -105,13 +106,17 @@ int run(int argc, char *argv[]) const auto r = app.setup(multiProcess, pick); pick = false; - if (r == RestartExitCode) { + if (r == RestartExitCode || r == ReselectExitCode) { // resets things when MO is "restarted" app.resetForRestart(); // don't reprocess command line cl.clear(); + if (r == ReselectExitCode) { + pick = true; + } + continue; } else if (r != 0) { // something failed, quit |
