diff options
| author | 2021-10-04 00:09:08 -0400 | |
|---|---|---|
| committer | 2021-10-04 00:09:08 -0400 | |
| commit | 01f79d638fbbca54280ab9b5840e5a483b7ceb69 (patch) | |
| tree | 6520b5f70f2d3132031610e39d6d7c50aa268838 /src/core/hle/kernel/svc.cpp | |
| parent | Merge pull request #7122 from Morph1984/update-qt (diff) | |
| parent | Fix KShareMemory object leak (diff) | |
| download | yuzu-01f79d638fbbca54280ab9b5840e5a483b7ceb69.tar.gz yuzu-01f79d638fbbca54280ab9b5840e5a483b7ceb69.tar.xz yuzu-01f79d638fbbca54280ab9b5840e5a483b7ceb69.zip | |
Merge pull request #7091 from vonchenplus/fix_memroy_leak
core: Fix memory leak
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 62fb06c45..f98f24a60 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -320,17 +320,19 @@ static ResultCode SendSyncRequest(Core::System& system, Handle handle) { | |||
| 320 | 320 | ||
| 321 | auto& kernel = system.Kernel(); | 321 | auto& kernel = system.Kernel(); |
| 322 | 322 | ||
| 323 | KScopedAutoObject session = | ||
| 324 | kernel.CurrentProcess()->GetHandleTable().GetObject<KClientSession>(handle); | ||
| 325 | R_UNLESS(session.IsNotNull(), ResultInvalidHandle); | ||
| 326 | LOG_TRACE(Kernel_SVC, "called handle=0x{:08X}({})", handle, session->GetName()); | ||
| 327 | |||
| 328 | auto thread = kernel.CurrentScheduler()->GetCurrentThread(); | 323 | auto thread = kernel.CurrentScheduler()->GetCurrentThread(); |
| 329 | { | 324 | { |
| 330 | KScopedSchedulerLock lock(kernel); | 325 | KScopedSchedulerLock lock(kernel); |
| 331 | thread->SetState(ThreadState::Waiting); | 326 | thread->SetState(ThreadState::Waiting); |
| 332 | thread->SetWaitReasonForDebugging(ThreadWaitReasonForDebugging::IPC); | 327 | thread->SetWaitReasonForDebugging(ThreadWaitReasonForDebugging::IPC); |
| 333 | session->SendSyncRequest(thread, system.Memory(), system.CoreTiming()); | 328 | |
| 329 | { | ||
| 330 | KScopedAutoObject session = | ||
| 331 | kernel.CurrentProcess()->GetHandleTable().GetObject<KClientSession>(handle); | ||
| 332 | R_UNLESS(session.IsNotNull(), ResultInvalidHandle); | ||
| 333 | LOG_TRACE(Kernel_SVC, "called handle=0x{:08X}({})", handle, session->GetName()); | ||
| 334 | session->SendSyncRequest(thread, system.Memory(), system.CoreTiming()); | ||
| 335 | } | ||
| 334 | } | 336 | } |
| 335 | 337 | ||
| 336 | KSynchronizationObject* dummy{}; | 338 | KSynchronizationObject* dummy{}; |