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

Cleanup of pointers in KSongInfo? #12

Open
SortaCore opened this issue Jan 2, 2018 · 1 comment
Open

Cleanup of pointers in KSongInfo? #12

SortaCore opened this issue Jan 2, 2018 · 1 comment

Comments

@SortaCore
Copy link

I understand if the song information should be safe to use indefinitely, you should use your own struct and pass it to GetSongInfo. However, the KSongInfo struct itself contains pointers, but not a way to dispose of the memory the pointers point to.
What's the cleanup process for them?
Are they static somehow, or a heap copy to be free()'d? The docs imply no freeing is necessary - although the lack of a "FreeSongInfo()" function is more implicit.
Currently I'm strdup()'ng all the pointers - the title and instrument names, and freeing them in a wrapper struct.
Could you please clarify on this point.

@kometbomb
Copy link
Owner

kometbomb commented Jan 2, 2018 via email

SortaCore added a commit to SortaCore/MMF2Exts that referenced this issue Jan 2, 2018
Fixes Klystrack not loading songs.
Still some dubious memory usage by Klystrack; I've opened issue
kometbomb/klystron#12 to see how that's
handled.
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

No branches or pull requests

2 participants