Skip to content

Conversation

@jserv
Copy link
Contributor

@jserv jserv commented Aug 2, 2025

This commit ensures custom widgets are unregistered from dispatch map before memory is freed. Previously, widget memory could be freed while still registered in the dispatch map, causing crashes when accessing freed widget pointers.

The fix modifies custom_widget_dispatch() to handle TwinEventDestroy, ensuring unregistration occurs before base widget destruction.

Summary by Bito

This pull request fixes a critical memory management bug in custom widgets by modifying the `custom_widget_dispatch` function to correctly handle destruction events. This ensures proper unregistration of widgets from the dispatch map before memory is freed, enhancing the stability of the widget system.

This commit ensures custom widgets are unregistered from dispatch map
before memory is freed. Previously, widget memory could be freed while
still registered in the dispatch map, causing crashes when accessing
freed widget pointers.

The fix modifies custom_widget_dispatch() to handle TwinEventDestroy,
ensuring unregistration occurs before base widget destruction.
@jserv jserv merged commit 3a95678 into main Aug 2, 2025
6 checks passed
@jserv jserv deleted the fix-widget-memory branch August 2, 2025 05:41
@jserv jserv mentioned this pull request Oct 16, 2025
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