Refactor and fix memory leak in theme_init #6

Manually merged
jabber.developer merged 3 commits from fix/theme-mem-leak into master 2025-06-24 15:37:14 +00:00
  • I ran valgrind when using my new feature
<!-- For completed items, change [ ] to [x]. --> - [x] I ran valgrind when using my new feature
jabber.developer added 3 commits 2025-06-24 13:54:24 +00:00
Simple `ui_resize` is sufficient for rerendering all the elements.
Other calls create complexity, slow down the applications and even introduce mem leaks.

`ui_resize` technique is already used widely, including `cmd_editor` case.

Fixes #4
The variable was introduced in 976e5aa. First used to detect bold characters, it was later replaced by another solution in 850ac3c.
ref(theme): ensure clean reinitialization and explicitly initialize static vars
Some checks failed
CI / Check spelling (pull_request) Successful in 18s
CI / Check coding style (pull_request) Failing after 28s
CI / Linux (debian) (pull_request) Successful in 9m39s
CI / Linux (ubuntu) (pull_request) Successful in 9m59s
CI / Linux (fedora) (pull_request) Successful in 10m38s
CI / Linux (arch) (pull_request) Successful in 16m6s
1c0f39db54
Improves code robustness by calling _theme_close() in theme_init() when the
theme was already initialized, preventing potential memory leaks or
inconsistent state.

Closes #4
admin force-pushed fix/theme-mem-leak from 1c0f39db54 to d5d5dc5180 2025-06-24 14:22:57 +00:00 Compare
jabber.developer manually merged commit 43bab6ff8f into master 2025-06-24 15:37:14 +00:00
Sign in to join this conversation.
No description provided.