aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/nvdrv/nvdrv.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-08-07 09:17:09 -0400
committerLioncash <mathew1800@gmail.com>2018-08-07 21:53:05 -0400
commitd378d98e2628f83fa56242ec6b53e3cce7c6bb56 (patch)
treec50db5a6d7840f493d970ba449aa7010124e9a88 /src/core/hle/service/nvdrv/nvdrv.cpp
parent825e8cb9252cdffd3f150ef667ecb95655ab0696 (diff)
nvdrv: Get rid of global std::weak_ptr
Rather than use global state, we can simply pass the instance into the NVFlinger instance directly.
Diffstat (limited to 'src/core/hle/service/nvdrv/nvdrv.cpp')
-rw-r--r--src/core/hle/service/nvdrv/nvdrv.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/hle/service/nvdrv/nvdrv.cpp b/src/core/hle/service/nvdrv/nvdrv.cpp
index e8b30921a..427f4b574 100644
--- a/src/core/hle/service/nvdrv/nvdrv.cpp
+++ b/src/core/hle/service/nvdrv/nvdrv.cpp
@@ -16,19 +16,18 @@
#include "core/hle/service/nvdrv/interface.h"
#include "core/hle/service/nvdrv/nvdrv.h"
#include "core/hle/service/nvdrv/nvmemp.h"
+#include "core/hle/service/nvflinger/nvflinger.h"
namespace Service::Nvidia {
-std::weak_ptr<Module> nvdrv;
-
-void InstallInterfaces(SM::ServiceManager& service_manager) {
+void InstallInterfaces(SM::ServiceManager& service_manager, NVFlinger::NVFlinger& nvflinger) {
auto module_ = std::make_shared<Module>();
std::make_shared<NVDRV>(module_, "nvdrv")->InstallAsService(service_manager);
std::make_shared<NVDRV>(module_, "nvdrv:a")->InstallAsService(service_manager);
std::make_shared<NVDRV>(module_, "nvdrv:s")->InstallAsService(service_manager);
std::make_shared<NVDRV>(module_, "nvdrv:t")->InstallAsService(service_manager);
std::make_shared<NVMEMP>()->InstallAsService(service_manager);
- nvdrv = module_;
+ nvflinger.SetNVDrvInstance(module_);
}
Module::Module() {