Fix SIGSEGV in Assembly solver during document restore

AssemblyObject::onChanged() was calling updateSolveStatus() when the
Group property changed during document restore. This triggered the
solver (solve -> validateNewPlacements) while child objects were still
being deserialized, causing a segfault in validateNewPlacements() due
to accessing uninitialized data.

Add isRestoring() and isPerformingTransaction() guards matching the
pattern used by GroupExtension::onChanged() and other FreeCAD modules.
This commit is contained in:
forbes
2026-01-29 23:54:10 -06:00
parent 1b1f74ed90
commit 9dc50cef72

View File

@@ -139,7 +139,10 @@ App::DocumentObjectExecReturn* AssemblyObject::execute()
void AssemblyObject::onChanged(const App::Property* prop)
{
if (prop == &Group) {
if (prop == &Group
&& !isRestoring()
&& getDocument()
&& !getDocument()->isPerformingTransaction()) {
updateSolveStatus();
}
App::Part::onChanged(prop);