mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-29 01:20:28 +00:00
UpdaterCommon: Remove manual UI::Stop() calls in favour of a scope guard to ensure it's called on all return paths
This commit is contained in:
parent
2ae409ba06
commit
3f1ba830e7
@ -16,6 +16,7 @@
|
|||||||
#include "Common/CommonPaths.h"
|
#include "Common/CommonPaths.h"
|
||||||
#include "Common/FileUtil.h"
|
#include "Common/FileUtil.h"
|
||||||
#include "Common/HttpRequest.h"
|
#include "Common/HttpRequest.h"
|
||||||
|
#include "Common/ScopeGuard.h"
|
||||||
#include "Common/StringUtil.h"
|
#include "Common/StringUtil.h"
|
||||||
#include "UpdaterCommon/UI.h"
|
#include "UpdaterCommon/UI.h"
|
||||||
|
|
||||||
@ -498,7 +499,6 @@ void FatalError(const std::string& message)
|
|||||||
|
|
||||||
UI::SetVisible(true);
|
UI::SetVisible(true);
|
||||||
UI::Error(message);
|
UI::Error(message);
|
||||||
UI::Stop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<Manifest> ParseManifest(const std::string& manifest)
|
std::optional<Manifest> ParseManifest(const std::string& manifest)
|
||||||
@ -686,6 +686,7 @@ bool RunUpdater(std::vector<std::string> args)
|
|||||||
UI::Init();
|
UI::Init();
|
||||||
UI::SetVisible(false);
|
UI::SetVisible(false);
|
||||||
|
|
||||||
|
Common::ScopeGuard ui_guard{[] { UI::Stop(); }};
|
||||||
Options opts = std::move(*maybe_opts);
|
Options opts = std::move(*maybe_opts);
|
||||||
|
|
||||||
if (opts.log_file)
|
if (opts.log_file)
|
||||||
@ -777,7 +778,5 @@ bool RunUpdater(std::vector<std::string> args)
|
|||||||
UI::LaunchApplication(opts.binary_to_restart.value());
|
UI::LaunchApplication(opts.binary_to_restart.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
UI::Stop();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user