Fix Valentina app crash after canceling a tool.

This commit is contained in:
Roman Telezhynskyi 2022-06-01 16:42:54 +03:00
parent f4d0d4aa2e
commit 5f2d0e95a8
5 changed files with 14 additions and 1 deletions

View File

@ -5,6 +5,7 @@
- Improved curve segment warnings. - Improved curve segment warnings.
- Tape app. Add action Add separator to menu. - Tape app. Add action Add separator to menu.
- Tape app. Fix crash after switching language. - Tape app. Fix crash after switching language.
- Fix Valentina app crash after canceling a tool.
# Valentina 0.7.51 April 18, 2022 # Valentina 0.7.51 April 18, 2022
- Z value change for a layout piece. - Z value change for a layout piece.

View File

@ -182,6 +182,9 @@ void DialogAlongLine::DeployFormulaTextEdit()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogAlongLine::~DialogAlongLine() DialogAlongLine::~DialogAlongLine()
{ {
auto *locData = const_cast<VContainer *> (data);
locData->RemoveVariable(currentLength);
delete ui; delete ui;
} }
@ -283,7 +286,7 @@ void DialogAlongLine::SetCurrentLength()
SCASSERT(length != nullptr) SCASSERT(length != nullptr)
length->SetName(currentLength); length->SetName(currentLength);
VContainer *locData = const_cast<VContainer *> (data); auto *locData = const_cast<VContainer *> (data);
locData->AddVariable(length); locData->AddVariable(length);
} }

View File

@ -147,6 +147,9 @@ void DialogCutArc::DeployFormulaTextEdit()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogCutArc::~DialogCutArc() DialogCutArc::~DialogCutArc()
{ {
auto *locData = const_cast<VContainer *> (data);
locData->RemoveVariable(currentLength);
delete ui; delete ui;
} }

View File

@ -106,6 +106,9 @@ DialogCutSpline::DialogCutSpline(const VContainer *data, quint32 toolId, QWidget
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogCutSpline::~DialogCutSpline() DialogCutSpline::~DialogCutSpline()
{ {
auto *locData = const_cast<VContainer *> (data);
locData->RemoveVariable(currentLength);
delete ui; delete ui;
} }

View File

@ -106,6 +106,9 @@ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, quint32 toolId,
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogCutSplinePath::~DialogCutSplinePath() DialogCutSplinePath::~DialogCutSplinePath()
{ {
auto *locData = const_cast<VContainer *> (data);
locData->RemoveVariable(currentLength);
delete ui; delete ui;
} }