NC/fix - App crashes (one more fix for the same issue) (#1632)

* fix - App crashes if during editing text add any object (one more fix for the same issue)

(cherry picked from commit 08a3b01929ac01de26a25883f3acded6a29c500b)

* fix - Upload doesn't called (active tool is not set on processTool)

(cherry picked from commit d914b2ba7ba4d1741f6e990587d13a5d08b0c591)

* fix - crash on draw (rollback optimisation)

(cherry picked from commit 2769c45eac69c6a36284a4d5a16ca2c49262d158)

Co-authored-by: Yuriy Puchkov <yuriy.puchkov@namecheap.com>
This commit is contained in:
Yurii Puchkov
2021-05-20 22:39:39 +03:00
committed by GitHub
parent ed3491f366
commit 401e6277eb

View File

@@ -309,15 +309,14 @@ void CaptureWidget::releaseActiveTool()
{
if (m_activeTool) {
if (m_activeTool->editMode()) {
// Object shouldn't be deleted here because it is in the undo/redo
// stack, just set current pointer to null
m_activeTool->setEditMode(false);
if (m_activeTool->isChanged()) {
pushObjectsStateToUndoStack();
}
}
if (-1 == m_panel->activeLayerIndex() && m_activeButton) {
// delete tool if no active selection, otherwise object shouldn't be
// deleted, because it is in undo/redo stack
m_activeTool->deleteLater();
} else {
delete m_activeTool;
}
m_activeTool = nullptr;
}