Skip to content

fix icon streamer#41

Open
tomvita wants to merge 1 commit into
PoloNX:masterfrom
tomvita:fix-icon-streamer
Open

fix icon streamer#41
tomvita wants to merge 1 commit into
PoloNX:masterfrom
tomvita:fix-icon-streamer

Conversation

@tomvita
Copy link
Copy Markdown

@tomvita tomvita commented Apr 17, 2026

What happens:

  • GlossyIcon stores a raw nxui::Texture* pointing directly into m_pool (a std::vector)
  • When navigating from page 0 to page 1, onPageChanged(1) needs to load page 2 icons (prefetch via kPageMargin=1). No free slots exist, so m_pool.reserve() is called to grow the pool
  • reserve() reallocates the vector, moving all TexSlot objects to new memory. Every Texture* pointer previously given to page 0 and page 1 icons now points to freed memory
  • Page 1 (the current page) renders blank because m_tex is dangling
  • The icons are still marked as "loaded" in m_appToSlot, so they never get re-loaded — until the user navigates far enough away to evict them, then comes back

The fix (lines 175-187):
After reserve(), compare m_pool.data() before and after. If the pool was relocated, iterate all pool slots and re-wire the Texture* pointer on every surviving GlossyIcon. This is O(pool_size) and only runs when an actual reallocation occurs, so there's negligible performance impact.

@PoloNX
Copy link
Copy Markdown
Owner

PoloNX commented May 1, 2026

Hi, I already fixed it so I don't think it's a great idea. what do you think ?

@tomvita
Copy link
Copy Markdown
Author

tomvita commented May 1, 2026

There are many ways to fix this problem, just wanted to share what I did. By the way taking over eshop don't work on HOS 22. Just move it to another applet and the crash stops.

@PoloNX
Copy link
Copy Markdown
Owner

PoloNX commented May 1, 2026

I'll do that. But why taking over eshop doesn't work now? I didn't see something about eshop in 22 changelog

@tomvita
Copy link
Copy Markdown
Author

tomvita commented May 1, 2026

You can try put something else there and it will crash too. Your home menu can sit there as long as you don't call it though.

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 this pull request may close these issues.

2 participants