core: Don't shutdown a null GPU

When CreateGPU fails, yuzu would try and shutdown the GPU instance
regardless of whether any instance was actually created.

Check for nullptr before calling its methods to prevent a crash.
master
lat9nq 2022-03-07 01:39:16 +07:00
parent 370e480c8c
commit 381f1dd2c9
1 changed files with 3 additions and 1 deletions

@ -326,7 +326,9 @@ struct System::Impl {
is_powered_on = false;
exit_lock = false;
gpu_core->NotifyShutdown();
if (gpu_core != nullptr) {
gpu_core->NotifyShutdown();
}
services.reset();
service_manager.reset();