fix(assembly): prevent segfault when all joints are removed #310
@@ -275,8 +275,14 @@ void AssemblyObject::updateSolveStatus()
|
|||||||
//+1 because there's a grounded joint to origin
|
//+1 because there's a grounded joint to origin
|
||||||
lastDoF = (1 + numberOfComponents()) * 6;
|
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();
|
solve();
|
||||||
|
updating = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!solver_) {
|
if (!solver_) {
|
||||||
|
|||||||
Reference in New Issue
Block a user