Skip to content

Fix some memory leaks with WrappedText and LoadArrayByNameAsVec3s #4144

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

Merged

Conversation

Archez
Copy link
Contributor

@Archez Archez commented May 9, 2024

WrappedText for UIWidgets was using strdup with having the return string freed up later. Rather than using strdup, we can just return std::string and have the caller execute .c_str() on the result and avoid malloc/free issues all together. (see #4043)

Also address a memory leak from LoadArrayByNameAsVec3s which mallocs a new array every call to it on the static pause link drawing. The Vec3s resource copies by value to the skelanime joint table, but the original Vec3s resource was not being freed after.

Build Artifacts

@garrettjoecox garrettjoecox merged commit 3f67fed into HarbourMasters:develop-macready May 10, 2024
8 checks passed
@Archez Archez deleted the fix-some-memory-leaks branch May 10, 2024 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants