# HG changeset patch # User Chris Cannam # Date 1563358850 -3600 # Node ID 1bf8b93dc006b59877316b02aab7c88281167ec5 # Parent 6df78d2b1b5eda29a5eff9388308fd150b8d975f Fix failure to stop transform when Cancel clicked diff -r 6df78d2b1b5e -r 1bf8b93dc006 main/MainWindow.cpp --- a/main/MainWindow.cpp Mon Jul 15 14:13:40 2019 +0100 +++ b/main/MainWindow.cpp Wed Jul 17 11:20:50 2019 +0100 @@ -3514,7 +3514,25 @@ SVDEBUG << "MainWindow::paneCancelButtonPressed: Layer " << layer << endl; + // We need to ensure that the transform that is populating this + // layer's model is stopped - that is the main reason to use + // Cancel after all. It would also be a good idea to remove the + // incomplete layer from both the view and the undo/redo stack. + + // Deleting the target model will ensure that the transform gets + // stopped, but removing the layer from the view is not enough to + // delete the model, because a reference to the layer remains on + // the undo/redo stack. If we also replace the model id with None + // in the layer, that does the trick. + + m_document->setModel(layer, {}); m_document->removeLayerFromView(pane, layer); + + // We still have a layer with no model on the undo/redo stack, + // which is a pity. I'm not sure we can easily remove it, since + // other commands may have been pushed on the stack since, so + // let's just leave that for now. + updateMenuStates(); } diff -r 6df78d2b1b5e -r 1bf8b93dc006 repoint-lock.json --- a/repoint-lock.json Mon Jul 15 14:13:40 2019 +0100 +++ b/repoint-lock.json Wed Jul 17 11:20:50 2019 +0100 @@ -4,13 +4,13 @@ "pin": "62987b6d6a3b" }, "svcore": { - "pin": "110f853c3149" + "pin": "d1e2062cbdec" }, "svgui": { - "pin": "3943d0720167" + "pin": "b43ff1abdc02" }, "svapp": { - "pin": "c8ba09756eff" + "pin": "ad5917362158" }, "checker": { "pin": "c8c17e51aab0"