Changeset - r27336:bc8a0445e3ab
[Not reviewed]
master
0 1 0
Patric Stout - 13 months ago 2023-05-13 16:23:23
truebrain@openttd.org
Fix: NewGRF Profile didn't stop if there were no events yet (#10816)

This meant you could have the following situation:
- You start a profile on a GRF with no events, for N days.
- The days pass, the profile should stop. It doesn't.
- The profile will never stop, even if the GRF start generating events.
- There is no real way to discover this, so .. byebye memory? :)
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/newgrf_profiling.cpp
Show inline comments
 
@@ -98,6 +98,8 @@ uint32 NewGRFProfiler::Finish()
 

	
 
	if (this->calls.empty()) {
 
		IConsolePrint(CC_DEBUG, "Finished profile of NewGRF [{:08X}], no events collected, not writing a file.", BSWAP32(this->grffile->grfid));
 

	
 
		this->Abort();
 
		return 0;
 
	}
 

	
 
@@ -116,7 +118,6 @@ uint32 NewGRFProfiler::Finish()
 
	}
 

	
 
	this->Abort();
 

	
 
	return total_microseconds;
 
}
 

	
0 comments (0 inline, 0 general)