1
0
forked from mirrors/0ad

Allow calling timer_DisplayClientTotals multiple times.

According to the `timer_DisplayClientTotals` comment 953d2621dd broke
correctness of `clients` after the function call.

Patch By: echotangoecho
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D812
This was SVN commit r23240.
This commit is contained in:
vladislavbelov
2019-12-14 22:49:44 +00:00
parent 6ada1d015d
commit b2665437fc
+1 -7
View File
@@ -183,14 +183,8 @@ void timer_DisplayClientTotals()
debug_printf("TIMER TOTALS (%lu clients)\n", (unsigned long)numClients);
debug_printf("-----------------------------------------------------\n");
while(clients)
for(TimerClient* tc = clients; tc; tc = tc->next)
{
// (make sure list and count are consistent)
ENSURE(numClients != 0);
TimerClient* tc = clients;
clients = tc->next;
numClients--;
const std::string duration = tc->sum.ToString();
debug_printf(" %s: %s (%lux)\n", utf8_from_wstring(tc->description).c_str(), duration.c_str(), (unsigned long)tc->num_calls);
}