Compare commits

..

1 Commits

Author SHA1 Message Date
d5d5dc5180 ref(theme): ensure clean reinitialization and explicitly initialize static vars
All checks were successful
CI / Check spelling (pull_request) Successful in 17s
CI / Check coding style (pull_request) Successful in 32s
CI / Linux (debian) (pull_request) Successful in 9m44s
CI / Linux (fedora) (pull_request) Successful in 10m40s
CI / Linux (ubuntu) (pull_request) Successful in 12m19s
CI / Linux (arch) (pull_request) Successful in 15m41s
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
2025-06-24 16:22:48 +02:00

View File

@@ -86,9 +86,9 @@ _theme_close(void)
void
theme_init(const char* const theme_name)
{
if(defaults || theme_loc || theme) {
if (defaults || theme_loc || theme) {
log_warning("theme_init(): Detected non-NULL state (theme=%p, theme_loc=%p, defaults=%p). Cleaning up previous initialization.",
theme, theme_loc, defaults);
theme, theme_loc, defaults);
_theme_close();
}