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

ktxTexture_SetImageFromMemory should document pointer lifetime guarantees #914

Closed
matthew-rister opened this issue May 31, 2024 · 2 comments · Fixed by #917
Closed

ktxTexture_SetImageFromMemory should document pointer lifetime guarantees #914

matthew-rister opened this issue May 31, 2024 · 2 comments · Fixed by #917

Comments

@matthew-rister
Copy link
Contributor

matthew-rister commented May 31, 2024

ktxTexture_SetImageFromMemory (and friends) expect a const ktx_uint8_t* to the image source in memory. It's unclear if this takes over ownership of the pointer or if it creates a copy of the underlying image memory. Upon further investigation, it appears it creates a copy of the image memory.

To better help users avoid memory leaks (by e.g. assuming a memory ownership transfer), corresponding KTX APIs should be updates to include a note about pointer lifetime assumptions.

@MarkCallow
Copy link
Collaborator

Please propose a PR.

@matthew-rister
Copy link
Contributor Author

@MarkCallow I have submitted a brief pull request with proposed documentation updates.

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 a pull request may close this issue.

2 participants