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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user