Skip to content

Fix thumbnail cache dangling pointer bug#63

Merged
nchapman merged 1 commit into
developfrom
feature/thumb-cache-refactor
Dec 8, 2025
Merged

Fix thumbnail cache dangling pointer bug#63
nchapman merged 1 commit into
developfrom
feature/thumb-cache-refactor

Conversation

@nchapman
Copy link
Copy Markdown
Collaborator

@nchapman nchapman commented Dec 8, 2025

Refactored cache into encapsulated ThumbCache struct that tracks the displayed item and auto-invalidates on eviction. Surfaces are now looked up fresh each frame instead of storing pointers that can go stale. Also fixed preloading to trigger on cache hits.

Refactored cache into encapsulated ThumbCache struct that tracks the displayed item and auto-invalidates on eviction. Surfaces are now looked up fresh each frame instead of storing pointers that can go stale. Also fixed preloading to trigger on cache hits.
Copilot AI review requested due to automatic review settings December 8, 2025 02:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the thumbnail cache to fix dangling pointer bugs by introducing an encapsulated ThumbCache struct that tracks the displayed item and auto-invalidates on eviction. The refactoring replaces raw array manipulation with a clean API that prevents storing stale surface pointers and ensures surfaces are looked up fresh each frame.

Key Changes:

  • Introduced ThumbCache and ThumbCacheItem structs with dedicated accessor functions
  • Added automatic tracking of the displayed item with eviction detection
  • Fixed preloading to trigger on cache hits (not just cache misses)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nchapman nchapman merged commit cd4fa18 into develop Dec 8, 2025
10 checks passed
@nchapman nchapman deleted the feature/thumb-cache-refactor branch December 8, 2025 02:56
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