Skip to content

Const specifier in Texture2D is blocking stbi_image_free(data_); #25

@dtorban

Description

@dtorban

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:

const unsigned char * data_ubyte_;

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions