summaryrefslogtreecommitdiff
path: root/src/core/core.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2020-11-24 14:31:58 -0800
committerGravatar GitHub2020-11-24 14:31:58 -0800
commit7791cc8c2e585dcc377e22a26f548db914250a5d (patch)
tree81273d60fee9da0146317881711b6f0b43650355 /src/core/core.cpp
parentMerge pull request #3681 from lioncash/component (diff)
downloadyuzu-7791cc8c2e585dcc377e22a26f548db914250a5d.tar.gz
yuzu-7791cc8c2e585dcc377e22a26f548db914250a5d.tar.xz
yuzu-7791cc8c2e585dcc377e22a26f548db914250a5d.zip
hle: services: Fix a crash with improper NVFlinger lifetime management. (#4977)
* hle: services: Fix a crash with improper NVFlinger lifetime management. - This crash would happen when attempting to shutdown yuzu early on in boot.
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r--src/core/core.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 5accdc783..1aa477a29 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -187,7 +187,7 @@ struct System::Impl {
187 187
188 service_manager = std::make_shared<Service::SM::ServiceManager>(kernel); 188 service_manager = std::make_shared<Service::SM::ServiceManager>(kernel);
189 189
190 Service::Init(service_manager, system); 190 services = std::make_unique<Service::Services>(service_manager, system);
191 GDBStub::DeferStart(); 191 GDBStub::DeferStart();
192 192
193 interrupt_manager = std::make_unique<Core::Hardware::InterruptManager>(system); 193 interrupt_manager = std::make_unique<Core::Hardware::InterruptManager>(system);
@@ -296,7 +296,7 @@ struct System::Impl {
296 296
297 // Shutdown emulation session 297 // Shutdown emulation session
298 GDBStub::Shutdown(); 298 GDBStub::Shutdown();
299 Service::Shutdown(); 299 services.reset();
300 service_manager.reset(); 300 service_manager.reset();
301 cheat_engine.reset(); 301 cheat_engine.reset();
302 telemetry_session.reset(); 302 telemetry_session.reset();
@@ -306,8 +306,8 @@ struct System::Impl {
306 cpu_manager.Shutdown(); 306 cpu_manager.Shutdown();
307 307
308 // Shutdown kernel and core timing 308 // Shutdown kernel and core timing
309 kernel.Shutdown();
310 core_timing.Shutdown(); 309 core_timing.Shutdown();
310 kernel.Shutdown();
311 311
312 // Close app loader 312 // Close app loader
313 app_loader.reset(); 313 app_loader.reset();
@@ -398,6 +398,9 @@ struct System::Impl {
398 /// Service manager 398 /// Service manager
399 std::shared_ptr<Service::SM::ServiceManager> service_manager; 399 std::shared_ptr<Service::SM::ServiceManager> service_manager;
400 400
401 /// Services
402 std::unique_ptr<Service::Services> services;
403
401 /// Telemetry session for this emulation session 404 /// Telemetry session for this emulation session
402 std::unique_ptr<Core::TelemetrySession> telemetry_session; 405 std::unique_ptr<Core::TelemetrySession> telemetry_session;
403 406