free the menu entry frames

This commit is contained in:
Dana Jansens 2003-08-28 17:05:44 +00:00
parent 21b07748af
commit 5efc7236a6

View file

@ -16,6 +16,9 @@
GList *menu_frame_visible; 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_render(ObMenuFrame *self);
static void menu_frame_update(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) void menu_frame_free(ObMenuFrame *self)
{ {
if (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)); stacking_remove(MENU_AS_WINDOW(self));
XDestroyWindow(ob_display, self->items); 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; ObMenuEntryFrame *self;
XSetWindowAttributes attr; XSetWindowAttributes attr;
@ -110,7 +119,7 @@ ObMenuEntryFrame* menu_entry_frame_new(ObMenuEntry *entry, ObMenuFrame *frame)
return self; return self;
} }
void menu_entry_frame_free(ObMenuEntryFrame *self) static void menu_entry_frame_free(ObMenuEntryFrame *self)
{ {
if (self) { if (self) {
XDestroyWindow(ob_display, self->icon); XDestroyWindow(ob_display, self->icon);
@ -170,7 +179,6 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self)
RrAppearance *item_a, *text_a; RrAppearance *item_a, *text_a;
gint th; /* temp */ gint th; /* temp */
ObMenu *sub; ObMenu *sub;
ObClientIcon *icon;
item_a = ((self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL && item_a = ((self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL &&
!self->entry->data.normal.enabled) ? !self->entry->data.normal.enabled) ?