Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Releases the memory a data handle is holding onto when exporting meshes. #2882

Merged
merged 7 commits into from
Mar 2, 2023

Conversation

AramAzhari-adsk
Copy link
Collaborator

When exporting the entire scene, a data handle is used to create objects for writing meshes. When the user tries to export all again, the previous handle is not cleaned up and this results in a memory leak. The fix is to destruct the handle after use so that the memory does not increase after repetition.

@AramAzhari-adsk AramAzhari-adsk added adsk Related to Autodesk plugin regression Something that used to work is no longer working labels Feb 16, 2023
@AramAzhari-adsk AramAzhari-adsk marked this pull request as draft February 16, 2023 14:17
@AramAzhari-adsk AramAzhari-adsk requested review from seando-adsk and removed request for seando-adsk February 16, 2023 14:18
@AramAzhari-adsk AramAzhari-adsk marked this pull request as ready for review February 16, 2023 16:55
Copy link
Collaborator

@seando-adsk seando-adsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also search thru the maya-usd repo and make sure there are no other uses asMDataHandle()

@AramAzhari-adsk
Copy link
Collaborator Author

AramAzhari-adsk commented Feb 22, 2023

Can you also search thru the maya-usd repo and make sure there are no other uses asMDataHandle()

@seando-adsk
There are two instances of this:

const float3& rgbColor = colorRGB.asMDataHandle().asFloat3();

.asMDataHandle(); // NOTE: (yliangsiew) This should be the pref mesh.

Should we check them in as part of the current jira ?

removed the extra copy statement

Co-authored-by: Sean Donnelly <[email protected]>
seando-adsk
seando-adsk previously approved these changes Feb 23, 2023
@AramAzhari-adsk AramAzhari-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Mar 1, 2023
@seando-adsk seando-adsk removed the regression Something that used to work is no longer working label Mar 2, 2023
@seando-adsk seando-adsk merged commit 24c79ad into dev Mar 2, 2023
@seando-adsk seando-adsk deleted the azharia/MAYA-124103/export-all-memory-leak-fix branch March 2, 2023 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adsk Related to Autodesk plugin ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants