From b2665437fce55bcb5279c34474fa9315c92c7392 Mon Sep 17 00:00:00 2001 From: vladislavbelov Date: Sat, 14 Dec 2019 22:49:44 +0000 Subject: [PATCH] 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. --- source/lib/timer.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/source/lib/timer.cpp b/source/lib/timer.cpp index 25f5d792f3..c6082c4e86 100644 --- a/source/lib/timer.cpp +++ b/source/lib/timer.cpp @@ -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); }