Skip to content

Commit f850231

Browse files
committed
module: implement debug things to figure out shutdown crash
1 parent 73ca096 commit f850231

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

source/module.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#include "convar.h"
55
#include "tier0/icommandline.h"
66

7+
static ConVar module_debug("holylib_module_debug", "0");
8+
79
CModule::~CModule()
810
{
911
if ( m_pCVar )
@@ -277,13 +279,17 @@ void CModuleManager::Setup(CreateInterfaceFn appfn, CreateInterfaceFn gamefn)
277279
#define VCALL_ENABLED_MODULES(call) \
278280
for (CModule* pModule : m_pModules) { \
279281
if ( !pModule->FastIsEnabled() ) { continue; } \
282+
if ( module_debug.GetBool() ) { Msg("holylib: Calling(V) %s on %s\n", #call, pModule->GetModule()->Name()); } \
280283
pModule->GetModule()-> call; \
284+
if ( module_debug.GetBool() ) { Msg("holylib: Finished calling(V) %s on %s\n", #call, pModule->GetModule()->Name()); } \
281285
}
282286

283287
#define CALL_ENABLED_MODULES(call) \
284288
for (CModule* pModule : m_pModules) { \
285289
if ( !pModule->FastIsEnabled() ) { continue; } \
290+
if ( module_debug.GetBool() ) { Msg("holylib: Calling %s on %s\n", #call, pModule->GetModule()->Name()); } \
286291
pModule-> call; \
292+
if ( module_debug.GetBool() ) { Msg("holylib: Finished calling %s on %s\n", #call, pModule->GetModule()->Name()); } \
287293
}
288294

289295

0 commit comments

Comments
 (0)