Ensure process is cleaned up, to avoid leaks
This commit is contained in:
		
					parent
					
						
							
								46365f4076
							
						
					
				
			
			
				commit
				
					
						00ff209fe7
					
				
			
		
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -32,8 +32,10 @@ bool XDGUtil(const std::string& util,
 | 
			
		|||
  if (!process.IsValid())
 | 
			
		||||
    return false;
 | 
			
		||||
 | 
			
		||||
  if (!wait_for_exit)
 | 
			
		||||
  if (!wait_for_exit) {
 | 
			
		||||
    base::EnsureProcessGetsReaped(process.Pid());
 | 
			
		||||
    return true;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  int exit_code = -1;
 | 
			
		||||
  if (!process.WaitForExit(&exit_code))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue