mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 13:00:32 +00:00
Fix two handle leaks during remote probe
Added logic to the entry point RENDERDOC_CreateRemoteServerConnection to shutdown the socket used to connect to a remote device when the function is used to test a connection (IRemoteServer **rend is null.) This previously created a handle leak, visible as accumulating /device/afd/ file handles on Windows. Added logic to the Windows specialization of Process::LaunchProcess so it will close two handles: hChildStdError_Rd, and hChildStdOutput_Rd if the handles were created successfully but the process failed to launch. Previously these would accumulate during a remote probe for Android devices if ADB was not present or otherwise failed to launch.
This commit is contained in:
committed by
Baldur Karlsson
parent
4409e57919
commit
783d76fe73
@@ -1247,7 +1247,10 @@ RENDERDOC_CreateRemoteServerConnection(const rdcstr &URL, IRemoteServer **rend)
|
||||
}
|
||||
|
||||
if(rend == NULL)
|
||||
{
|
||||
SAFE_DELETE(sock);
|
||||
return RDResult(ResultCode::Succeeded);
|
||||
}
|
||||
|
||||
if(protocol)
|
||||
*rend = protocol->CreateRemoteServer(sock, deviceID);
|
||||
|
||||
@@ -1060,6 +1060,12 @@ uint32_t Process::LaunchProcess(const rdcstr &app, const rdcstr &workingDir, con
|
||||
{
|
||||
if(!internal)
|
||||
RDCWARN("Couldn't launch process '%s'", appPath.c_str());
|
||||
|
||||
if(hChildStdError_Rd != NULL)
|
||||
CloseHandle(hChildStdError_Rd);
|
||||
if(hChildStdOutput_Rd != NULL)
|
||||
CloseHandle(hChildStdOutput_Rd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user