]> git.mdlowis.com Git - proto/labwc.git/commitdiff
theme: fix memory leak of button icons
authorJohn Lindgren <john@jlindgren.net>
Mon, 8 Jul 2024 14:56:20 +0000 (10:56 -0400)
committerJohan Malm <johanmalm@users.noreply.github.com>
Mon, 8 Jul 2024 18:44:50 +0000 (19:44 +0100)
src/theme.c

index 904aeadf4624c0570a549bede69668cf12117049..248a352ab9849fa461879fc6e15bc8ae6906a825 100644 (file)
@@ -1397,10 +1397,35 @@ theme_init(struct theme *theme, struct server *server, const char *theme_name)
 void
 theme_finish(struct theme *theme)
 {
+       zdrop(&theme->button_close_active_unpressed);
+       zdrop(&theme->button_maximize_active_unpressed);
+       zdrop(&theme->button_restore_active_unpressed);
+       zdrop(&theme->button_iconify_active_unpressed);
+       zdrop(&theme->button_menu_active_unpressed);
+
+       zdrop(&theme->button_close_inactive_unpressed);
+       zdrop(&theme->button_maximize_inactive_unpressed);
+       zdrop(&theme->button_restore_inactive_unpressed);
+       zdrop(&theme->button_iconify_inactive_unpressed);
+       zdrop(&theme->button_menu_inactive_unpressed);
+
+       zdrop(&theme->button_close_active_hover);
+       zdrop(&theme->button_maximize_active_hover);
+       zdrop(&theme->button_restore_active_hover);
+       zdrop(&theme->button_iconify_active_hover);
+       zdrop(&theme->button_menu_active_hover);
+
+       zdrop(&theme->button_close_inactive_hover);
+       zdrop(&theme->button_maximize_inactive_hover);
+       zdrop(&theme->button_restore_inactive_hover);
+       zdrop(&theme->button_iconify_inactive_hover);
+       zdrop(&theme->button_menu_inactive_hover);
+
        zdrop(&theme->corner_top_left_active_normal);
        zdrop(&theme->corner_top_left_inactive_normal);
        zdrop(&theme->corner_top_right_active_normal);
        zdrop(&theme->corner_top_right_inactive_normal);
+
        zdrop(&theme->shadow_corner_top_active);
        zdrop(&theme->shadow_corner_bottom_active);
        zdrop(&theme->shadow_edge_active);