From a7110733d5c094a2cdb4d038f917c5c951798aef Mon Sep 17 00:00:00 2001 From: Maxime Gervais Date: Tue, 24 Dec 2024 00:22:16 +0100 Subject: [PATCH] Fix hang when processing additional stats Signed-off-by: Maxime Gervais --- Source/Core/CommonStats.cpp | 3 --- Source/Core/CommonStats.h | 8 +++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/Core/CommonStats.cpp b/Source/Core/CommonStats.cpp index c91266977..5f7d850b7 100644 --- a/Source/Core/CommonStats.cpp +++ b/Source/Core/CommonStats.cpp @@ -263,9 +263,6 @@ void CommonStats::writeAdditionalStats(std::stringstream &stream, size_t index) void CommonStats::updateAdditionalStats(StatsValueInfo::Type type, size_t oldSize, size_t size) { - // Lock data - QMutexLocker Lock(&Mutex); - if (type==StatsValueInfo::Int) { auto additionalIntStats_Old = additionalIntStats; diff --git a/Source/Core/CommonStats.h b/Source/Core/CommonStats.h index bb1e50d46..a94d33213 100644 --- a/Source/Core/CommonStats.h +++ b/Source/Core/CommonStats.h @@ -166,7 +166,6 @@ class CommonStats typedef std::string StringStatsKey; void initializeAdditionalStats(); - void updateAdditionalStats(StatsValueInfo::Type type, size_t oldSize, size_t size); void processAdditionalStats(const char* key, const char* value, bool statsMapInitialized); void writeAdditionalStats(std::stringstream& stream, size_t index); @@ -200,8 +199,11 @@ class CommonStats double** additionalDoubleStats; char*** additionalStringStats; - // Thread synchronisation - QMutex Mutex; + // Thread synchronisation + QMutex Mutex; + + // Internal functions + void updateAdditionalStats(StatsValueInfo::Type type, size_t oldSize, size_t size); }; #endif // Stats_H