Skip to content

Commit

Permalink
Clean up temp lists in KJRMultiJointManager after finishing joint upd…
Browse files Browse the repository at this point in the history
…ates
  • Loading branch information
siimav committed Mar 19, 2024
1 parent 17f708e commit fc2c8fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,9 @@ private void RunVesselJointUpdateFunction(Vessel v)
if (success || !child_parts)
updatedVessels.Add(v);

multiJointManager.ClearTempLists();
decouplerJointManager.ClearTempLists();

Profiler.EndSample();
if (KJRJointUtils.settings.debug) Debug.Log($"[KJR] RunVesselJointUpdateFunction finished in {sw.Elapsed.TotalMilliseconds}ms");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,5 +228,12 @@ public void OnJointBreak(Part part)
multiJointDict.Remove(part);
}
}

public void ClearTempLists()
{
linkPart1List.Clear();
linkPart2List.Clear();
linkedSet.Clear();
}
}
}

0 comments on commit fc2c8fa

Please sign in to comment.