Commit 9a7cb4bd authored by Boudewijn Rempt's avatar Boudewijn Rempt

Copy the liquify arguments instead of assigning an SP to an SP

I don't know why this only crashed in ASAN builds, maybe pure
luck, but apparently assigning a QSharedPointer::operator=
causes a double delete when both shared pointers to the same
object go out of scope.

BUG:405737
parent 2fa4d82b
......@@ -27,6 +27,34 @@
#include "kis_debug.h"
#include "kis_dom_utils.h"
KisLiquifyProperties::KisLiquifyProperties(const KisLiquifyProperties &rhs)
{
m_mode = rhs.m_mode;
m_size = rhs.m_size;
m_amount = rhs.m_amount;
m_spacing = rhs.m_spacing;
m_sizeHasPressure = rhs.m_sizeHasPressure;
m_amountHasPressure = rhs.m_amountHasPressure;
m_reverseDirection = rhs.m_reverseDirection;
m_useWashMode = rhs.m_useWashMode;
m_flow = rhs.m_flow;
}
KisLiquifyProperties &KisLiquifyProperties::operator=(const KisLiquifyProperties &rhs)
{
m_mode = rhs.m_mode;
m_size = rhs.m_size;
m_amount = rhs.m_amount;
m_spacing = rhs.m_spacing;
m_sizeHasPressure = rhs.m_sizeHasPressure;
m_amountHasPressure = rhs.m_amountHasPressure;
m_reverseDirection = rhs.m_reverseDirection;
m_useWashMode = rhs.m_useWashMode;
m_flow = rhs.m_flow;
return *this;
}
bool KisLiquifyProperties::operator==(const KisLiquifyProperties &other) const
{
return
......
......@@ -53,6 +53,11 @@ public:
{
}
KisLiquifyProperties(const KisLiquifyProperties &rhs);
KisLiquifyProperties& operator=(const KisLiquifyProperties &rhs);
bool operator==(const KisLiquifyProperties &other) const;
LiquifyMode mode() const {
......
......@@ -129,7 +129,7 @@ ToolTransformArgs& ToolTransformArgs::operator=(const ToolTransformArgs& args)
{
clear();
m_liquifyProperties = args.m_liquifyProperties;
m_liquifyProperties.reset(new KisLiquifyProperties(*args.m_liquifyProperties.data()));
init(args);
return *this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment