Commit 24355db3 authored by Tusooa Zhu's avatar Tusooa Zhu 🅱

Fix the crash when ending interaction immediately

We'd better delete the node in the GUI thread since it is
moved there upon creation. Otherwise ~QObject() will complain
about killing timer in a different thread.
parent bdaca3ba
......@@ -122,6 +122,13 @@ void KisNodeReplaceBasedStrokeStrategy::finishStrokeCallback()
KUndo2CommandSP cmd(new Private::NodeReplaceCommand(m_d->affectedNode, m_d->originalState, name()));
m_d->postExecUndoAdapter->addCommand(cmd);
} else {
/// HACK alert: we have to delete the node in the gui thread
KisNode *node = m_d->originalState.data();
node->ref();
m_d->originalState.clear();
node->deref();
node->deleteLater();
}
}
......@@ -129,3 +136,8 @@ void KisNodeReplaceBasedStrokeStrategy::setChanged(bool changed)
{
m_d->nodeChanged = changed;
}
KisNodeSP KisNodeReplaceBasedStrokeStrategy::nodeOriginalState()
{
return m_d->originalState;
}
......@@ -49,6 +49,10 @@ public:
*/
void setChanged(bool changed);
public:
/// internal
KisNodeSP nodeOriginalState();
private:
struct Private;
QScopedPointer<Private> m_d;
......
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