Merge pull request #1133 from cxd4/WriteTrace-no-crash
[Common] Evade null pointer exception while tracing pre-AppInit().
This commit is contained in:
commit
2e0cc5d5bc
|
@ -12,6 +12,17 @@
|
||||||
#endif
|
#endif
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* g_ModuleLogLevel may be NULL while AppInit() is still in session in path.cpp.
|
||||||
|
* The added check to compare to NULL here is at least a temporary workaround.
|
||||||
|
*/
|
||||||
|
#undef WriteTrace
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define WriteTrace(m, s, format, ...) if (g_ModuleLogLevel != NULL && g_ModuleLogLevel[(m)] >= (s)) { WriteTraceFull((m), (s), __FILE__, __LINE__, __FUNCTION__, (format), ## __VA_ARGS__); }
|
||||||
|
#else
|
||||||
|
#define WriteTrace(m, s, format, ...) if (g_ModuleLogLevel != NULL && g_ModuleLogLevel[(m)] >= (s)) { WriteTraceFull((m), (s), __FILE__, __LINE__, __PRETTY_FUNCTION__, (format), ## __VA_ARGS__); }
|
||||||
|
#endif
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Constants
|
// Constants
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue