Attempted fix for strange COM failure on build machine. (integrate from FN12.10)

#jira UE-88759
#rb aaron.mcleran ethan.geller

[CL 11558912 by jimmy smith in 4.25 branch]
This commit is contained in:
jimmy smith
2020-02-19 20:26:43 -05:00
parent 297a92f30b
commit cd458bd718
4 changed files with 16 additions and 0 deletions

View File

@@ -1628,6 +1628,16 @@ bool FWindowsPlatformProcess::Daemonize()
return true;
}
void FWindowsPlatformProcess::SetupAudioThread()
{
ensure(FPlatformMisc::CoInitialize());
}
void FWindowsPlatformProcess::TeardownAudioThread()
{
FPlatformMisc::CoUninitialize();
}
/**
* Maps a relative virtual address (RVA) to an address in memory.
*

View File

@@ -222,6 +222,9 @@ struct CORE_API FGenericPlatformProcess
/** Allow the platform to do anything it needs for audio thread */
static void SetupAudioThread() { }
/** Allow the platform to tear down the audio thread */
static void TeardownAudioThread() { }
/** Content saved to the game or engine directories should be rerouted to user directories instead **/
static bool ShouldSaveToUserDir();

View File

@@ -186,6 +186,8 @@ public:
static FSemaphore* NewInterprocessSynchObject(const TCHAR* Name, bool bCreate, uint32 MaxLocks = 1);
static bool DeleteInterprocessSynchObject(FSemaphore * Object);
static bool Daemonize();
static void SetupAudioThread();
static void TeardownAudioThread();
protected:
/**

View File

@@ -192,6 +192,7 @@ bool FAudioThread::Init()
void FAudioThread::Exit()
{
GAudioThreadId = 0;
FPlatformProcess::TeardownAudioThread();
}
uint32 FAudioThread::Run()