summaryrefslogtreecommitdiff
path: root/src/core/loader/nro.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2018-09-29 15:57:40 -0400
committerGravatar Lioncash2018-09-29 16:00:03 -0400
commita63e6f9dfd75f89841817a0185d606da52c7a4a6 (patch)
tree5ebf817e2c5ce6736d89e938769be3f73fbb30f4 /src/core/loader/nro.cpp
parentMerge pull request #1388 from FearlessTobi/port-4258 (diff)
downloadyuzu-a63e6f9dfd75f89841817a0185d606da52c7a4a6.tar.gz
yuzu-a63e6f9dfd75f89841817a0185d606da52c7a4a6.tar.xz
yuzu-a63e6f9dfd75f89841817a0185d606da52c7a4a6.zip
loader: Make the Load() function take a process as a regular reference, not a SharedPtr
A process should never require being reference counted in this situation. If the handle to a process is freed before this function is called, it's definitely a bug with our lifetime management, so we can put the requirement in place for the API that the process must be a valid instance.
Diffstat (limited to 'src/core/loader/nro.cpp')
-rw-r--r--src/core/loader/nro.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/loader/nro.cpp b/src/core/loader/nro.cpp
index b72871efa..8ad973c3a 100644
--- a/src/core/loader/nro.cpp
+++ b/src/core/loader/nro.cpp
@@ -175,19 +175,19 @@ bool AppLoader_NRO::LoadNro(FileSys::VirtualFile file, VAddr load_base) {
175 return true; 175 return true;
176} 176}
177 177
178ResultStatus AppLoader_NRO::Load(Kernel::SharedPtr<Kernel::Process>& process) { 178ResultStatus AppLoader_NRO::Load(Kernel::Process& process) {
179 if (is_loaded) { 179 if (is_loaded) {
180 return ResultStatus::ErrorAlreadyLoaded; 180 return ResultStatus::ErrorAlreadyLoaded;
181 } 181 }
182 182
183 // Load NRO 183 // Load NRO
184 const VAddr base_address = process->vm_manager.GetCodeRegionBaseAddress(); 184 const VAddr base_address = process.vm_manager.GetCodeRegionBaseAddress();
185 185
186 if (!LoadNro(file, base_address)) { 186 if (!LoadNro(file, base_address)) {
187 return ResultStatus::ErrorLoadingNRO; 187 return ResultStatus::ErrorLoadingNRO;
188 } 188 }
189 189
190 process->Run(base_address, Kernel::THREADPRIO_DEFAULT, Memory::DEFAULT_STACK_SIZE); 190 process.Run(base_address, Kernel::THREADPRIO_DEFAULT, Memory::DEFAULT_STACK_SIZE);
191 191
192 is_loaded = true; 192 is_loaded = true;
193 return ResultStatus::Success; 193 return ResultStatus::Success;