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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user