@@ -270,6 +270,29 @@ ScatterplotPlugin::ScatterplotPlugin(const PluginFactory* factory) :
270270
271271ScatterplotPlugin::~ScatterplotPlugin ()
272272{
273+ // Ensure proper cleanup order - disconnect any remaining connections
274+ // before member variables are destroyed
275+ if (_scatterPlotWidget) {
276+ disconnect (_scatterPlotWidget, nullptr , this , nullptr );
277+ disconnect (&_scatterPlotWidget->getPixelSelectionTool (), nullptr , this , nullptr );
278+ }
279+
280+ // Clear any remaining connections from position dataset
281+ if (_positionDataset.isValid ()) {
282+ disconnect (&_positionDataset, nullptr , this , nullptr );
283+ }
284+
285+ // Disconnect all connections from settings action members to avoid
286+ // accessing freed memory during member destruction
287+ disconnect (&_settingsAction, nullptr , this , nullptr );
288+ disconnect (&_settingsAction.getColoringAction (), nullptr , this , nullptr );
289+ disconnect (&_settingsAction.getColoringAction ().getColorByAction (), nullptr , this , nullptr );
290+ disconnect (&_settingsAction.getPlotAction ().getPointPlotAction ().getFocusSelection (), nullptr , this , nullptr );
291+ disconnect (&_settingsAction.getPlotAction ().getPointPlotAction ().getSizeAction (), nullptr , this , nullptr );
292+ disconnect (&_settingsAction.getPlotAction ().getPointPlotAction ().getOpacityAction (), nullptr , this , nullptr );
293+
294+ // Disconnect from sampler action
295+ disconnect (&getSamplerAction (), nullptr , this , nullptr );
273296}
274297
275298void ScatterplotPlugin::init ()
@@ -972,6 +995,9 @@ void ScatterplotPlugin::updateSelection()
972995
973996void ScatterplotPlugin::updateHeadsUpDisplay ()
974997{
998+ #ifdef __APPLE__
999+ return ;
1000+ #endif
9751001 getHeadsUpDisplayAction ().removeAllHeadsUpDisplayItems ();
9761002
9771003 if (_positionDataset.isValid ()) {
0 commit comments