summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/svc
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2024-01-02 23:12:16 +0100
committerLiam <byteslice@airmail.cc>2024-01-13 00:31:33 +0100
commitf90a022d3a20c86399f49a8154847b73bc1b8fd3 (patch)
tree672214411189aaf408febc5aa9cc01e45aed5f5f /src/core/hle/kernel/svc
parentkernel: fix page leak on process termination (diff)
downloadyuzu-f90a022d3a20c86399f49a8154847b73bc1b8fd3.tar
yuzu-f90a022d3a20c86399f49a8154847b73bc1b8fd3.tar.gz
yuzu-f90a022d3a20c86399f49a8154847b73bc1b8fd3.tar.bz2
yuzu-f90a022d3a20c86399f49a8154847b73bc1b8fd3.tar.lz
yuzu-f90a022d3a20c86399f49a8154847b73bc1b8fd3.tar.xz
yuzu-f90a022d3a20c86399f49a8154847b73bc1b8fd3.tar.zst
yuzu-f90a022d3a20c86399f49a8154847b73bc1b8fd3.zip
Diffstat (limited to 'src/core/hle/kernel/svc')
-rw-r--r--src/core/hle/kernel/svc/svc_process.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/hle/kernel/svc/svc_process.cpp b/src/core/hle/kernel/svc/svc_process.cpp
index caa8bee9a..5c3e8829f 100644
--- a/src/core/hle/kernel/svc/svc_process.cpp
+++ b/src/core/hle/kernel/svc/svc_process.cpp
@@ -74,13 +74,15 @@ Result GetProcessList(Core::System& system, s32* out_num_processes, u64 out_proc
}
auto& memory = GetCurrentMemory(kernel);
- const auto& process_list = kernel.GetProcessList();
+ auto process_list = kernel.GetProcessList();
+ auto it = process_list.begin();
+
const auto num_processes = process_list.size();
const auto copy_amount =
std::min(static_cast<std::size_t>(out_process_ids_size), num_processes);
- for (std::size_t i = 0; i < copy_amount; ++i) {
- memory.Write64(out_process_ids, process_list[i]->GetProcessId());
+ for (std::size_t i = 0; i < copy_amount && it != process_list.end(); ++i, ++it) {
+ memory.Write64(out_process_ids, (*it)->GetProcessId());
out_process_ids += sizeof(u64);
}