From 5efc7236a682dc64db5bb7929b88efa72fdb1198 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 28 Aug 2003 17:05:44 +0000 Subject: [PATCH] free the menu entry frames --- openbox/menuframe.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 8126b5d5..053034b3 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -16,6 +16,9 @@ GList *menu_frame_visible; +static ObMenuEntryFrame* menu_entry_frame_new(ObMenuEntry *entry, + ObMenuFrame *frame); +static void menu_entry_frame_free(ObMenuEntryFrame *self); static void menu_frame_render(ObMenuFrame *self); static void menu_frame_update(ObMenuFrame *self); @@ -60,6 +63,11 @@ ObMenuFrame* menu_frame_new(ObMenu *menu, ObClient *client) void menu_frame_free(ObMenuFrame *self) { if (self) { + while (self->entries) { + menu_entry_frame_free(self->entries->data); + self->entries = g_list_delete_link(self->entries, self->entries); + } + stacking_remove(MENU_AS_WINDOW(self)); XDestroyWindow(ob_display, self->items); @@ -73,7 +81,8 @@ void menu_frame_free(ObMenuFrame *self) } } -ObMenuEntryFrame* menu_entry_frame_new(ObMenuEntry *entry, ObMenuFrame *frame) +static ObMenuEntryFrame* menu_entry_frame_new(ObMenuEntry *entry, + ObMenuFrame *frame) { ObMenuEntryFrame *self; XSetWindowAttributes attr; @@ -110,7 +119,7 @@ ObMenuEntryFrame* menu_entry_frame_new(ObMenuEntry *entry, ObMenuFrame *frame) return self; } -void menu_entry_frame_free(ObMenuEntryFrame *self) +static void menu_entry_frame_free(ObMenuEntryFrame *self) { if (self) { XDestroyWindow(ob_display, self->icon); @@ -170,7 +179,6 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self) RrAppearance *item_a, *text_a; gint th; /* temp */ ObMenu *sub; - ObClientIcon *icon; item_a = ((self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL && !self->entry->data.normal.enabled) ? -- 2.45.2