Skip to content

[mgear_solvers] Fix memory leak in rollSplineKine: replace dynamic MQuaternion array#572

Merged
miquelcampos merged 1 commit intomgear-dev:masterfrom
yamahigashi:develop
Nov 7, 2025
Merged

[mgear_solvers] Fix memory leak in rollSplineKine: replace dynamic MQuaternion array#572
miquelcampos merged 1 commit intomgear-dev:masterfrom
yamahigashi:develop

Conversation

@yamahigashi
Copy link
Copy Markdown
Contributor

Description of Changes

Removed the use of dynamically allocated MQuaternion* rot array and replaced it with direct quaternion extraction at interpolation time. Now retrieves the rotation from MTransformationMatrix directly for the two key indices (index1temp, index2temp) and performs spherical linear interpolation (slerp) between them.
This simplifies memory management and eliminates potential leaks.

Testing Done

  • Verified the plugin compiles successfully in Maya 2020, 2022, 2023, 2024, 2025, 2026 windows SDK.
  • Tested roll spline node behavior.
  • Checked for absence of memory leaks.

@miquelcampos miquelcampos self-assigned this Oct 29, 2025
@miquelcampos miquelcampos added the enhancement New feature or request label Oct 29, 2025
@github-project-automation github-project-automation bot moved this to To Do in mGear DEV Oct 29, 2025
@miquelcampos miquelcampos added the bug Something isn't working label Oct 29, 2025
@miquelcampos
Copy link
Copy Markdown
Member

@yamahigashi Thanks for the PR.
I will keep it and eventually merge it.
Did you find any memory leak before?
Thanks again!

@miquelcampos miquelcampos moved this from To Do to WIP in mGear DEV Oct 29, 2025
@yamahigashi
Copy link
Copy Markdown
Contributor Author

@miquelcampos Thanks for checking, Yes, I roughly confirmed it. I created about 100 leg_2jnt_01 components and ran animation for around 10 minutes. The memory growth was noticeable before the fix, but stable after applying it. I’ve also attached the scene file I used for the test.
572_rollSplineKine_memory_leak_scene.zip

@miquelcampos
Copy link
Copy Markdown
Member

@yamahigashi Thanks for the explanation. I will try to merge it and compile again the solvers ASAP. Thanks

@miquelcampos miquelcampos merged commit 14760b5 into mgear-dev:master Nov 7, 2025
0 of 3 checks passed
@github-project-automation github-project-automation bot moved this from WIP to 5.2.0 in mGear DEV Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

Status: 5.2.0

Development

Successfully merging this pull request may close these issues.

2 participants