You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Live Coding: Prevent compiling from the IDE while a Live Coding session is active. Engine runtime creates a global mutex with the executable path in the a name and leaks the handle, then UBT checks for it existing before allowing a build to start.
#rb none #jira UE-74438 #ROBOMERGE-OWNER: robert.manuszewski #ROBOMERGE-AUTHOR: ben.marsh #ROBOMERGE-SOURCE: CL 6957113 in //UE4/Release-4.23/... via CL 6966779 #ROBOMERGE-BOT: CORE (Main -> Dev-Core) (v367-6836689) [CL 6997861 by ben marsh in Dev-Core branch]
This commit is contained in:
@@ -291,6 +291,25 @@ bool FLiveCodingModule::StartLiveCoding()
|
||||
}
|
||||
LppSetBuildArguments(*Arguments);
|
||||
|
||||
// Create a mutex that allows UBT to detect that we shouldn't hot-reload into this executable. The handle to it will be released automatically when the process exits.
|
||||
FString ExecutablePath = FPaths::ConvertRelativePathToFull(FPlatformProcess::ExecutablePath());
|
||||
|
||||
FString MutexName = TEXT("Global\\LiveCoding_");
|
||||
for (int Idx = 0; Idx < ExecutablePath.Len(); Idx++)
|
||||
{
|
||||
TCHAR Character = ExecutablePath[Idx];
|
||||
if (Character == '/' || Character == '\\' || Character == ':')
|
||||
{
|
||||
MutexName += '+';
|
||||
}
|
||||
else
|
||||
{
|
||||
MutexName += Character;
|
||||
}
|
||||
}
|
||||
|
||||
ensure(CreateMutex(NULL, Windows::FALSE, *MutexName));
|
||||
|
||||
// Configure all the current modules. For non-commandlets, schedule it to be done in the first Tick() so we can batch everything together.
|
||||
if (IsRunningCommandlet())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user