Skip to content

Commit

Permalink
UserChart Scaling causes crash
Browse files Browse the repository at this point in the history
.. 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
  • Loading branch information
liversedge committed Aug 25, 2021
1 parent 73d2866 commit cc8b6b1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Charts/UserChart.cpp
Expand Up @@ -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;

Expand All @@ -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
Expand Down

0 comments on commit cc8b6b1

Please sign in to comment.