[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.
This commit is contained in:
Ajinkya Dahale
2022-02-07 12:20:40 -05:00
committed by abdullahtahiriyo
parent 5c817bf5e4
commit 3d452d9396

View File

@@ -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 {