Minor changes to avoid undefined behaviour warnings.
Avoid creating a reference from a nullptr. Avoid trying a malloc and memcpy into a 0 length buffer. Virtual trains should never be drawn.
This commit is contained in:
@@ -51,7 +51,7 @@ struct CPerfStartReal
|
||||
{
|
||||
CPerformanceTimer *m_pperf;
|
||||
|
||||
inline CPerfStartReal(CPerformanceTimer& perf) : m_pperf(&perf)
|
||||
inline CPerfStartReal(CPerformanceTimer* perf) : m_pperf(perf)
|
||||
{
|
||||
if (m_pperf != NULL) m_pperf->Start();
|
||||
}
|
||||
@@ -72,7 +72,7 @@ struct CPerfStartReal
|
||||
|
||||
struct CPerfStartFake
|
||||
{
|
||||
inline CPerfStartFake(CPerformanceTimer& perf) {}
|
||||
inline CPerfStartFake(CPerformanceTimer* perf) {}
|
||||
inline ~CPerfStartFake() {}
|
||||
inline void Stop() {}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user