Skip to content

Fix memory leaks in widget/window lifecycle #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2025
Merged

Fix memory leaks in widget/window lifecycle #117

merged 1 commit into from
Jul 31, 2025

Conversation

jserv
Copy link
Contributor

@jserv jserv commented Jul 31, 2025

This adds proper destroy event handling throughout the widget hierarchy to fix memory leaks:

  • box: Propagate destroy events to all child widgets before destruction
  • widget: Add TwinEventDestroy case to base widget dispatch
  • label: Free dynamically allocated label text on destroy
  • window: Invoke destroy callbacks to allow proper resource cleanup
  • pixmap: Initialize window field to prevent undefined behavior

Summary by Bito

This pull request addresses memory leaks by implementing proper destroy event handling in the widget and window lifecycle. Key changes include propagating destroy events to child widgets, freeing dynamically allocated resources, and initializing fields to prevent undefined behavior.

This adds proper destroy event handling throughout the widget hierarchy
to fix memory leaks:
- box: Propagate destroy events to all child widgets before destruction
- widget: Add TwinEventDestroy case to base widget dispatch
- label: Free dynamically allocated label text on destroy
- window: Invoke destroy callbacks to allow proper resource cleanup
- pixmap: Initialize window field to prevent undefined behavior
@jserv jserv merged commit cbfc915 into main Jul 31, 2025
6 checks passed
@jserv jserv deleted the fix-memory-bugs branch July 31, 2025 09:11
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.

1 participant