Skip to content

Commit da5701d

Browse files
committed
Prevent possible race
1 parent 8203961 commit da5701d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ScatterplotPlugin.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,10 @@ void ScatterplotPlugin::init()
334334
connect(&getSamplerAction(), &ViewPluginSamplerAction::sampleContextRequested, this, &ScatterplotPlugin::samplePoints);
335335

336336
connect(&_positionDataset, &Dataset<Points>::changed, this, &ScatterplotPlugin::positionDatasetChanged);
337-
connect(&_positionDataset, &Dataset<Points>::dataChanged, this, &ScatterplotPlugin::updateData);
337+
connect(&_positionDataset, &Dataset<Points>::dataChanged, this, [this]() -> void {
338+
updateData();
339+
updateHeadsUpDisplay();
340+
});
338341
connect(&_positionDataset, &Dataset<Points>::dataSelectionChanged, this, &ScatterplotPlugin::updateSelection);
339342

340343
_scatterPlotWidget->installEventFilter(this);
@@ -392,7 +395,6 @@ void ScatterplotPlugin::init()
392395

393396
updateHeadsUpDisplay();
394397

395-
connect(&_positionDataset, &Dataset<>::changed, this, &ScatterplotPlugin::updateHeadsUpDisplay);
396398
connect(&_positionDataset, &Dataset<>::guiNameChanged, this, &ScatterplotPlugin::updateHeadsUpDisplay);
397399

398400
const auto currentColorDatasetChanged = [this](Dataset<DatasetImpl> currentColorDataset) -> void {

0 commit comments

Comments
 (0)