Skip to content

ImageCache keyed by const char* hashes/compares the pointer. not the content #56

Description

@kimkulling

Describe the bug
ImageCache keyed by const char* (tinyui.h:160): hashes/compares the pointer, not the string — so the cache lookup at widgets.cpp:51
misbehaves across different pointers holding equal paths. Correctness-adjacent, but it also defeats the cache (duplicate loads).
Use std::string as the key.

To Reproduce

  1. Add an image to the imagecache
  2. Use 2 different strings with the same context and add them to the cache
  3. See that there will be 2 entries instead of one

Expected behavior
There shall only one entry.

Screenshots
NA

Desktop (please complete the following information):

  • OS: All

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions