Skip to content

Commit 57c870c

Browse files
committed
no signal callbacks can fire on the ScatterplotPlugin object while it's being destroyed, preventing the memory corruption that was causing the crash
1 parent 25ef918 commit 57c870c

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/ScatterplotPlugin.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,27 @@ ScatterplotPlugin::ScatterplotPlugin(const PluginFactory* factory) :
270270

271271
ScatterplotPlugin::~ScatterplotPlugin()
272272
{
273+
disconnect(this);
273274
if (_positionDataset.isValid()) {
274275
disconnect(&_positionDataset, nullptr, this, nullptr);
275276
}
277+
278+
if (_scatterPlotWidget) {
279+
disconnect(_scatterPlotWidget, nullptr, this, nullptr);
280+
disconnect(&_scatterPlotWidget->getPixelSelectionTool(), nullptr, this, nullptr);
281+
disconnect(&_scatterPlotWidget->getPointRendererNavigator().getNavigationAction().getZoomSelectionAction(), nullptr, this, nullptr);
282+
}
283+
disconnect(&_settingsAction, nullptr, this, nullptr);
284+
disconnect(&_settingsAction.getColoringAction(), nullptr, this, nullptr);
285+
disconnect(&_settingsAction.getColoringAction().getColorByAction(), nullptr, this, nullptr);
286+
disconnect(&_settingsAction.getPlotAction().getPointPlotAction().getFocusSelection(), nullptr, this, nullptr);
287+
disconnect(&_settingsAction.getPlotAction().getPointPlotAction().getSizeAction(), nullptr, this, nullptr);
288+
disconnect(&_settingsAction.getPlotAction().getPointPlotAction().getOpacityAction(), nullptr, this, nullptr);
289+
disconnect(&_settingsAction.getColoringAction(), &ColoringAction::currentColorDatasetChanged, this, &ScatterplotPlugin::updateHeadsUpDisplay);
290+
disconnect(&_settingsAction.getColoringAction().getColorByAction(), &OptionAction::currentIndexChanged, this, &ScatterplotPlugin::updateHeadsUpDisplay);
291+
disconnect(&_settingsAction.getPlotAction().getPointPlotAction().getSizeAction(), &ScalarAction::sourceDataChanged, this, &ScatterplotPlugin::updateHeadsUpDisplay);
292+
disconnect(&_settingsAction.getPlotAction().getPointPlotAction().getOpacityAction(), &ScalarAction::sourceDataChanged, this, &ScatterplotPlugin::updateHeadsUpDisplay);
293+
disconnect(&getSamplerAction(), nullptr, this, nullptr);
276294
}
277295

278296
void ScatterplotPlugin::init()

0 commit comments

Comments
 (0)