Stats - Fixed a memory leak in the UFE, added better implementation for the stats advance frame

#codereview Robert.Manuszewski

[CL 2103266 by Jaroslaw Surowiec in Main branch]
This commit is contained in:
Jaroslaw Surowiec
2014-06-12 12:09:36 -04:00
committed by UnrealBot
parent c50537fa33
commit f3b04ddb1c
6 changed files with 93 additions and 64 deletions

View File

@@ -77,7 +77,6 @@ bool RunDeployCommand()
double DeltaTime = 0.0;
double LastTime = FPlatformTime::Seconds();
static int32 MasterDisableChangeTagStartFrame = -1;
// We track the message sent time because we have to keep updating the loop until the message is *actually sent*. (ie all packets queued, sent, buffer flushed, etc.)
double MessageSentTime = 0.0;
@@ -222,6 +221,7 @@ void WriteString(FArchive* File, const ANSICHAR* Format, ...)
void RunStatsConvertCommand()
{
#if STATS
// get the target file
FString TargetFile;
FParse::Value(FCommandLine::Get(), TEXT("-INFILE="), TargetFile);
@@ -337,9 +337,9 @@ void RunStatsConvertCommand()
break;
}
}
#endif // STATS
}
void RunUI()
{
FString UnrealFrontendLayoutIni = FPaths::GetPath(GEngineIni) + "/Layout.ini";
@@ -409,7 +409,6 @@ void RunUI()
double DeltaTime = 0.0;
double LastTime = FPlatformTime::Seconds();
const float IdealFrameTime = 1.0f / IDEAL_FRAMERATE;
static int32 MasterDisableChangeTagStartFrame = -1;
while (!GIsRequestingExit)
{
@@ -430,11 +429,7 @@ void RunUI()
DeltaTime = CurrentTime - LastTime;
LastTime = CurrentTime;
#if STATS
FThreadStats::ExplicitFlush();
FThreadStats::WaitForStats();
MasterDisableChangeTagStartFrame = FThreadStats::MasterDisableChangeTag();
#endif
FStats::AdvanceFrame( false );
GLog->FlushThreadedLogs();
}