forked from eden-emu/eden
		
	Fix KScopedAutoObject object leak when SendSyncRequest
This commit is contained in:
		
							parent
							
								
									7663705803
								
							
						
					
					
						commit
						974547f98f
					
				
					 1 changed files with 8 additions and 6 deletions
				
			
		|  | @ -320,17 +320,19 @@ static ResultCode SendSyncRequest(Core::System& system, Handle handle) { | ||||||
| 
 | 
 | ||||||
|     auto& kernel = system.Kernel(); |     auto& kernel = system.Kernel(); | ||||||
| 
 | 
 | ||||||
|     KScopedAutoObject session = |  | ||||||
|         kernel.CurrentProcess()->GetHandleTable().GetObject<KClientSession>(handle); |  | ||||||
|     R_UNLESS(session.IsNotNull(), ResultInvalidHandle); |  | ||||||
|     LOG_TRACE(Kernel_SVC, "called handle=0x{:08X}({})", handle, session->GetName()); |  | ||||||
| 
 |  | ||||||
|     auto thread = kernel.CurrentScheduler()->GetCurrentThread(); |     auto thread = kernel.CurrentScheduler()->GetCurrentThread(); | ||||||
|     { |     { | ||||||
|         KScopedSchedulerLock lock(kernel); |         KScopedSchedulerLock lock(kernel); | ||||||
|         thread->SetState(ThreadState::Waiting); |         thread->SetState(ThreadState::Waiting); | ||||||
|         thread->SetWaitReasonForDebugging(ThreadWaitReasonForDebugging::IPC); |         thread->SetWaitReasonForDebugging(ThreadWaitReasonForDebugging::IPC); | ||||||
|         session->SendSyncRequest(thread, system.Memory(), system.CoreTiming()); | 
 | ||||||
|  |         { | ||||||
|  |             KScopedAutoObject session = | ||||||
|  |                 kernel.CurrentProcess()->GetHandleTable().GetObject<KClientSession>(handle); | ||||||
|  |             R_UNLESS(session.IsNotNull(), ResultInvalidHandle); | ||||||
|  |             LOG_TRACE(Kernel_SVC, "called handle=0x{:08X}({})", handle, session->GetName()); | ||||||
|  |             session->SendSyncRequest(thread, system.Memory(), system.CoreTiming()); | ||||||
|  |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     KSynchronizationObject* dummy{}; |     KSynchronizationObject* dummy{}; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Feng Chen
						Feng Chen