]> Dogcows Code - chaz/openbox/commitdiff
free the menu entry frames
authorDana Jansens <danakj@orodu.net>
Thu, 28 Aug 2003 17:05:44 +0000 (17:05 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 28 Aug 2003 17:05:44 +0000 (17:05 +0000)
openbox/menuframe.c

index 8126b5d5fde8da8e70c66cf82cf234eed65e1cca..053034b3869a783ddae60bfb6821447368e4e4f1 100644 (file)
@@ -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) ?
This page took 0.023917 seconds and 4 git commands to generate.