From 8888489aedc8ff3ca35ae9cecb3ba947b9227bfb Mon Sep 17 00:00:00 2001 From: Ajinkya Dahale Date: Mon, 7 Feb 2022 12:20:40 -0500 Subject: [PATCH] [Sketcher] Add comment suggesting future segfault fixes Apparently B-Spline knot insertion is challenging the sketcher update process and spurious GUI updates sometimes occur in the intermediate step after the knot is inserted but before the internal geometries are re-defined. This set of comments points to a previous fix and related discussion as a suggestion. --- src/Mod/Sketcher/App/SketchObject.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 86f55b1789..a02c0a384e 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -6066,6 +6066,13 @@ bool SketchObject::insertBSplineKnot(int GeoId, double param, int multiplicity) // Trigger update now // Update geometry indices and rebuild vertexindex now via onChanged, so that ViewProvider::UpdateData is triggered. if (!delGeoId.empty()) { + // NOTE: There have been a couple of instances when knot insertion has + // led to a segmentation fault: see https://forum.freecadweb.org/viewtopic.php?f=19&t=64962&sid=10272db50a635c633260517b14ecad37. + // If a segfault happens again and a `Geometry.touch()` here fixes it, + // it is possible that `delGeometriesExclusiveList` is causing an update + // in constraint GUI features during an intermediate step. + // See 247a9f0876a00e08c25b07d1f8802479d8623e87 for suggestions. + // Geometry.touch(); delGeometriesExclusiveList(delGeoId); } else {