Skip to content

Commit 3eb3a44

Browse files
committed
add destructor
1 parent 277b966 commit 3eb3a44

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/ScalarSourceAction.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ ScalarSourceAction::ScalarSourceAction(QObject* parent, const QString& title) :
3131
_offsetAction.setSuffix("px");
3232

3333
const auto scalarSourceChanged = [this]() -> void {
34+
35+
if (_destroyed) return;
36+
3437
const auto sourceIndex = _pickerAction.getCurrentIndex();
3538

3639
_dimensionPickerAction.setEnabled(sourceIndex >= ScalarSourceModel::DefaultRow::DatasetStart);
@@ -61,6 +64,11 @@ ScalarSourceAction::ScalarSourceAction(QObject* parent, const QString& title) :
6164
scalarSourceChanged();
6265
}
6366

67+
ScalarSourceAction::~ScalarSourceAction()
68+
{
69+
_destroyed = true;
70+
}
71+
6472
ScalarSourceModel& ScalarSourceAction::getModel()
6573
{
6674
return _model;

src/ScalarSourceAction.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ class ScalarSourceAction : public GroupAction
2929
*/
3030
Q_INVOKABLE ScalarSourceAction(QObject* parent, const QString& title);
3131

32+
/** Destructor */
33+
~ScalarSourceAction() override;
34+
3235
/** Get the scalar source model */
3336
ScalarSourceModel& getModel();
3437

@@ -88,6 +91,7 @@ class ScalarSourceAction : public GroupAction
8891
DimensionPickerAction _dimensionPickerAction; /** Dimension picker action */
8992
DecimalAction _offsetAction; /** Scalar source offset action */
9093
DecimalRangeAction _rangeAction; /** Range action */
94+
bool _destroyed = false;
9195

9296
friend class mv::AbstractActionsManager;
9397
};

0 commit comments

Comments
 (0)