Open dtorban opened 8 months ago
Saw there was a comment here about not being able to call stbi_image_free(...):
https://github.com/ivlab/MinGfx/blob/b5f51d9c17b88c0777b3ff48c1eaf349eaec8f12/src/texture2d.cc#L52C11-L52C34
I'm pretty sure this is because it is defined as const unsigned char* here:
https://github.com/ivlab/MinGfx/blob/b5f51d9c17b88c0777b3ff48c1eaf349eaec8f12/src/texture2d.h#L124
Removing the const should fix this issue. Otherwise, we could always make a copy of the array so that it is const and free after the copy.
Saw there was a comment here about not being able to call stbi_image_free(...):
https://github.com/ivlab/MinGfx/blob/b5f51d9c17b88c0777b3ff48c1eaf349eaec8f12/src/texture2d.cc#L52C11-L52C34
I'm pretty sure this is because it is defined as const unsigned char* here:
https://github.com/ivlab/MinGfx/blob/b5f51d9c17b88c0777b3ff48c1eaf349eaec8f12/src/texture2d.h#L124
Removing the const should fix this issue. Otherwise, we could always make a copy of the array so that it is const and free after the copy.