Skip to content

Commit 396e808

Browse files
authored
Add control destruction and memory management section
Added section on control destruction and memory management, including recommendations for explicit destruction and specific destruction order for certain controls.
1 parent 5a13c7b commit 396e808

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,20 @@ Note: Image display is a feature introduced experimentally in a fork of libui-ng
529529
- Almost all basic control functions such as `Window`, `Label`, and `Button` are covered.
530530
- APIs for advanced controls such as `Table` and `Area` are also provided. However, these are still under development and there may still be memory management issues.
531531

532+
## Control Destruction and Memory Management
533+
534+
The ownership tree mechanism works well for most simple controls, allowing automatic memory deallocation through garbage collection.
535+
However, due to the unpredictable timing of GC execution, it is advisable to explicitly destroy the main window before `UIng.uninit` performs its memory leak check when in doubt.
536+
537+
Some controls require specific destruction order for proper memory cleanup
538+
- [#6](https://github.com/kojix2/uing/issues/6)
539+
- Table
540+
- [#19](https://github.com/kojix2/uing/issues/19)
541+
- MultilineEntry
542+
- Tab
543+
- Grid
544+
- Area
545+
532546
## Limitations
533547

534548
libui-ng is cross-platform, but comes with some limitations:

0 commit comments

Comments
 (0)