You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Everything in libksnd at least SHOULD be something that you don't need to
free yourself, apart from using the KSND_Free* API's. Funnily enough, I
looked into the ksnd.c file and thought the exact strings should probably
be copied. Need to check what has been my train of thought there.
2018-01-02 7:31 GMT+02:00 Phi <[email protected]>:
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.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#12>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABCK6b65Wo6SKa15A87JFBgdxjB8KY4Oks5tGb80gaJpZM4RQTJa>
.
SortaCore
added a commit
to SortaCore/MMF2Exts
that referenced
this issue
Jan 2, 2018
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.
The text was updated successfully, but these errors were encountered: