From cc8b6b114df4980ed630c2064fc9dc05ab0a3e69 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Wed, 25 Aug 2021 09:48:44 +0100 Subject: [PATCH] UserChart Scaling causes crash .. when moving the scaling slider the charts get updated immediately, this causes a SEGV as charts are deleted whilst they are being updated. .. we now block updates whilst critical processing is happenning to avoid this. Fixes #4026 --- src/Charts/UserChart.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Charts/UserChart.cpp b/src/Charts/UserChart.cpp index 0680726a0..113551817 100644 --- a/src/Charts/UserChart.cpp +++ b/src/Charts/UserChart.cpp @@ -947,8 +947,13 @@ UserChartSettings::refreshChartInfo() void UserChartSettings::updateChartInfo() { + static bool blocked=false; + // if refresh chart info is updating, just ignore for now... - if (updating) return; + if (blocked || updating) return; + + // don't interrupt as charts get zapped too soon... + blocked = true; bool refresh=true; @@ -965,6 +970,8 @@ UserChartSettings::updateChartInfo() // we need to refresh whenever stuff changes.... if (refresh) emit chartConfigChanged(); + + blocked = false; // now we can process another... } void