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.
ktxTexture_SetImageFromMemory
(and friends) expect aconst 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.