Merge pull request 'fix(assembly): prevent segfault when all joints are removed' (#310) from fix/assembly-empty-joints-segfault into main
Some checks failed
Build and Test / build (push) Has been cancelled
Some checks failed
Build and Test / build (push) Has been cancelled
Reviewed-on: #310
This commit was merged in pull request #310.
This commit is contained in:
@@ -275,8 +275,14 @@ void AssemblyObject::updateSolveStatus()
|
||||
//+1 because there's a grounded joint to origin
|
||||
lastDoF = (1 + numberOfComponents()) * 6;
|
||||
|
||||
if (!solver_ || lastResult_.placements.empty()) {
|
||||
// Guard against re-entrancy: solve() calls updateSolveStatus(), so if
|
||||
// placements are legitimately empty (e.g. zero constraints / all parts
|
||||
// grounded) the recursive solve() would never terminate.
|
||||
static bool updating = false;
|
||||
if (!updating && (!solver_ || lastResult_.placements.empty())) {
|
||||
updating = true;
|
||||
solve();
|
||||
updating = false;
|
||||
}
|
||||
|
||||
if (!solver_) {
|
||||
|
||||
Reference in New Issue
Block a user