Skip to content

Commit f05afa2

Browse files
committed
memory corruption crash fix
1 parent a3f9eaa commit f05afa2

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

src/ScatterplotPlugin.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ ScatterplotPlugin::~ScatterplotPlugin()
275275
if (_scatterPlotWidget) {
276276
disconnect(_scatterPlotWidget, nullptr, this, nullptr);
277277
disconnect(&_scatterPlotWidget->getPixelSelectionTool(), nullptr, this, nullptr);
278+
// Remove from parent to prevent double-deletion by Qt's cleanup
279+
_scatterPlotWidget->setParent(nullptr);
280+
delete _scatterPlotWidget;
281+
_scatterPlotWidget = nullptr;
278282
}
279283

280284
// Clear any remaining connections from position dataset
@@ -293,6 +297,13 @@ ScatterplotPlugin::~ScatterplotPlugin()
293297

294298
// Disconnect from sampler action
295299
disconnect(&getSamplerAction(), nullptr, this, nullptr);
300+
301+
// Clean up drop widget after scatterplot widget to maintain proper order
302+
if (_dropWidget) {
303+
_dropWidget->setParent(nullptr);
304+
delete _dropWidget;
305+
_dropWidget = nullptr;
306+
}
296307
}
297308

298309
void ScatterplotPlugin::init()

0 commit comments

Comments
 (0)