Skip to content

Commit e29b13a

Browse files
committed
Added debug logging for crash investigation
1 parent cd5b740 commit e29b13a

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed

Client/mods/deathmatch/logic/CClientEntity.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ CClientEntity::CClientEntity(ElementID ID) : ClassInit(this)
6060
g_pCore->UpdateDummyProgress();
6161
}
6262

63+
#pragma inline_depth(0)
6364
CClientEntity::~CClientEntity(void)
6465
{
6566
// Make sure we won't get deleted later by the element deleter if we've been requested so
@@ -164,6 +165,7 @@ CClientEntity::~CClientEntity(void)
164165
g_pCore->GetGraphics()->GetRenderItemManager()->RemoveClientEntityRefs(this);
165166
g_pCore->UpdateDummyProgress();
166167
}
168+
#pragma inline_depth(254)
167169

168170
// Static function
169171
// bool CClientEntity::IsValidEntity ( CClientEntity* pEntity )

Client/mods/deathmatch/logic/CClientMarkerManager.cpp

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,43 @@ void CClientMarkerManager::DeleteAll(void)
5353

5454
void CClientMarkerManager::DoPulse(void)
5555
{
56-
bool bDisableCrashFix = (g_pCore->GetDiagnosticDebug() == EDiagnosticDebug::MARKER_PULSE);
57-
if (!bDisableCrashFix)
58-
m_Markers.SuspendModifyOperations();
56+
uint uiSkipCount = 0;
57+
uint uiAddCount = 0;
58+
m_Markers.SuspendModifyOperations();
5959
// Pulse all our markers
6060
CFastList<CClientMarker*>::const_iterator iter = m_Markers.begin();
6161
for (; iter != m_Markers.end(); iter++)
6262
{
63-
(*iter)->DoPulse();
63+
bool bSkip = false;
64+
for (auto suspended : m_Markers.m_SuspendedOperationList)
65+
{
66+
if (suspended.item == (*iter))
67+
bSkip = true;
68+
}
69+
if (!bSkip)
70+
(*iter)->DoPulse();
71+
else
72+
uiSkipCount++;
73+
}
74+
75+
for (uint i = 0; i < m_Markers.m_SuspendedOperationList.size(); i++)
76+
{
77+
auto suspended = m_Markers.m_SuspendedOperationList[i];
78+
if (suspended.operation != CFastList<CClientMarker*>::EOperation::Remove)
79+
{
80+
suspended.item->DoPulse();
81+
uiAddCount++;
82+
}
83+
}
84+
m_Markers.ResumeModifyOperations();
85+
86+
// Debug logging
87+
static uint uiSkipCountNonZeroes = 0;
88+
static uint uiAddCountNonZeroes = 0;
89+
if ((uiSkipCount && uiSkipCountNonZeroes < 5) || (uiAddCount && uiAddCountNonZeroes < 5))
90+
{
91+
uiSkipCountNonZeroes += (uiSkipCount ? 1 : 0);
92+
uiAddCountNonZeroes += (uiAddCount ? 1 : 0);
93+
AddReportLog(4450, SString("CClientMarkerManager::DoPulse uiSkipCount:%d uiAddCount:%d", uiSkipCount, uiAddCount));
6494
}
65-
if (!bDisableCrashFix)
66-
m_Markers.ResumeModifyOperations();
6795
}

0 commit comments

Comments
 (0)