Fix Development build issue with Flax.Build running in Development mode
This commit is contained in:
@@ -1079,7 +1079,6 @@ int32 WindowsPlatform::RunProcess(const StringView& cmdLine, const StringView& w
|
||||
|
||||
HANDLE stdOutRead = nullptr;
|
||||
HANDLE stdErrRead = nullptr;
|
||||
Array<byte> attributeList;
|
||||
|
||||
if (captureStdOut)
|
||||
{
|
||||
@@ -1101,8 +1100,7 @@ int32 WindowsPlatform::RunProcess(const StringView& cmdLine, const StringView& w
|
||||
SIZE_T bufferSize = 0;
|
||||
if (!InitializeProcThreadAttributeList(nullptr, 1, 0, &bufferSize) && GetLastError() == ERROR_INSUFFICIENT_BUFFER)
|
||||
{
|
||||
attributeList.Resize((int32)bufferSize);
|
||||
startupInfoEx.lpAttributeList = (LPPROC_THREAD_ATTRIBUTE_LIST)attributeList.Get();
|
||||
startupInfoEx.lpAttributeList = (LPPROC_THREAD_ATTRIBUTE_LIST)Allocator::Allocate(bufferSize);
|
||||
if (!InitializeProcThreadAttributeList(startupInfoEx.lpAttributeList, 1, 0, &bufferSize))
|
||||
{
|
||||
LOG(Warning, "InitializeProcThreadAttributeList failed");
|
||||
@@ -1126,9 +1124,6 @@ int32 WindowsPlatform::RunProcess(const StringView& cmdLine, const StringView& w
|
||||
goto ERROR_EXIT;
|
||||
}
|
||||
|
||||
if (environmentStr)
|
||||
Allocator::Free(environmentStr);
|
||||
|
||||
if (stdOutRead != nullptr)
|
||||
{
|
||||
// Keep reading std output and std error streams until process is running
|
||||
@@ -1177,6 +1172,10 @@ ERROR_EXIT:
|
||||
{
|
||||
DeleteProcThreadAttributeList(startupInfoEx.lpAttributeList);
|
||||
}
|
||||
if (environmentStr)
|
||||
Allocator::Free(environmentStr);
|
||||
if (startupInfoEx.lpAttributeList)
|
||||
Allocator::Free(startupInfoEx.lpAttributeList);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user