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.
This commit is contained in:
parent
0921558a9f
commit
a63e6f9dfd
18 changed files with 28 additions and 42 deletions
|
@ -175,19 +175,19 @@ bool AppLoader_NRO::LoadNro(FileSys::VirtualFile file, VAddr load_base) {
|
|||
return true;
|
||||
}
|
||||
|
||||
ResultStatus AppLoader_NRO::Load(Kernel::SharedPtr<Kernel::Process>& process) {
|
||||
ResultStatus AppLoader_NRO::Load(Kernel::Process& process) {
|
||||
if (is_loaded) {
|
||||
return ResultStatus::ErrorAlreadyLoaded;
|
||||
}
|
||||
|
||||
// Load NRO
|
||||
const VAddr base_address = process->vm_manager.GetCodeRegionBaseAddress();
|
||||
const VAddr base_address = process.vm_manager.GetCodeRegionBaseAddress();
|
||||
|
||||
if (!LoadNro(file, base_address)) {
|
||||
return ResultStatus::ErrorLoadingNRO;
|
||||
}
|
||||
|
||||
process->Run(base_address, Kernel::THREADPRIO_DEFAULT, Memory::DEFAULT_STACK_SIZE);
|
||||
process.Run(base_address, Kernel::THREADPRIO_DEFAULT, Memory::DEFAULT_STACK_SIZE);
|
||||
|
||||
is_loaded = true;
|
||||
return ResultStatus::Success;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue