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.
This commit is contained in:
bunnei 2020-11-24 14:31:58 -08:00 committed by GitHub
parent fbda5e9ec9
commit 7791cc8c2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 104 additions and 100 deletions

View file

@ -29,7 +29,11 @@ namespace Service {
namespace FileSystem {
class FileSystemController;
} // namespace FileSystem
}
namespace NVFlinger {
class NVFlinger;
}
namespace SM {
class ServiceManager;
@ -181,10 +185,17 @@ private:
}
};
/// Initialize ServiceManager
void Init(std::shared_ptr<SM::ServiceManager>& sm, Core::System& system);
/**
* The purpose of this class is to own any objects that need to be shared across the other service
* implementations. Will be torn down when the global system instance is shutdown.
*/
class Services final {
public:
explicit Services(std::shared_ptr<SM::ServiceManager>& sm, Core::System& system);
~Services();
/// Shutdown ServiceManager
void Shutdown();
private:
std::unique_ptr<NVFlinger::NVFlinger> nv_flinger;
};
} // namespace Service