diff options
| author | 2019-05-28 21:12:23 -0400 | |
|---|---|---|
| committer | 2019-05-28 22:28:15 -0400 | |
| commit | 215fd827384904f1cb7fa689ff8cd3f61dbbd007 (patch) | |
| tree | 3c5d144f741228e966e13b576bfa0cadbaebd5fa /src/core/core.cpp | |
| parent | core/telemetry_session: Explicitly delete copy and move constructors (diff) | |
| download | yuzu-215fd827384904f1cb7fa689ff8cd3f61dbbd007.tar.gz yuzu-215fd827384904f1cb7fa689ff8cd3f61dbbd007.tar.xz yuzu-215fd827384904f1cb7fa689ff8cd3f61dbbd007.zip | |
core/telemetry_session: Remove usages of the global system accessor
Makes the dependency explicit in the TelemetrySession's interface
instead of making it a hidden dependency.
This also revealed a hidden issue with the way the telemetry session was
being initialized. It was attempting to retrieve the app loader and log
out title-specific information. However, this isn't always guaranteed to
be possible.
During the initialization phase, everything is being constructed. It
doesn't mean an actual title has been selected. This is what the Load()
function is for. This potentially results in dead code paths involving
the app loader. Instead, we explicitly add this information when we know
the app loader instance is available.
Diffstat (limited to 'src/core/core.cpp')
| -rw-r--r-- | src/core/core.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 7106151bd..9f9356f53 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -144,7 +144,6 @@ struct System::Impl { | |||
| 144 | ResultStatus Load(System& system, Frontend::EmuWindow& emu_window, | 144 | ResultStatus Load(System& system, Frontend::EmuWindow& emu_window, |
| 145 | const std::string& filepath) { | 145 | const std::string& filepath) { |
| 146 | app_loader = Loader::GetLoader(GetGameFileFromPath(virtual_filesystem, filepath)); | 146 | app_loader = Loader::GetLoader(GetGameFileFromPath(virtual_filesystem, filepath)); |
| 147 | |||
| 148 | if (!app_loader) { | 147 | if (!app_loader) { |
| 149 | LOG_CRITICAL(Core, "Failed to obtain loader for {}!", filepath); | 148 | LOG_CRITICAL(Core, "Failed to obtain loader for {}!", filepath); |
| 150 | return ResultStatus::ErrorGetLoader; | 149 | return ResultStatus::ErrorGetLoader; |
| @@ -167,6 +166,7 @@ struct System::Impl { | |||
| 167 | return init_result; | 166 | return init_result; |
| 168 | } | 167 | } |
| 169 | 168 | ||
| 169 | telemetry_session->AddInitialInfo(*app_loader); | ||
| 170 | auto main_process = Kernel::Process::Create(system, "main"); | 170 | auto main_process = Kernel::Process::Create(system, "main"); |
| 171 | const auto [load_result, load_parameters] = app_loader->Load(*main_process); | 171 | const auto [load_result, load_parameters] = app_loader->Load(*main_process); |
| 172 | if (load_result != Loader::ResultStatus::Success) { | 172 | if (load_result != Loader::ResultStatus::Success) { |