]> Dogcows Code - chaz/openbox/commitdiff
plug memory leaks from the new strut code
authorDana Jansens <danakj@orodu.net>
Wed, 13 Jun 2007 01:58:34 +0000 (01:58 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 13 Jun 2007 01:58:34 +0000 (01:58 +0000)
openbox/client.c
openbox/dock.c
openbox/focus_cycle_popup.c
openbox/frame.c
openbox/keyboard.c
openbox/menuframe.c
openbox/place.c
openbox/popup.c

index 8e6e1e390e48d537c5ad3fb43f58b25928a1ac4f..df494a9fc1d3edb95a40894e1801389050c1e690 100644 (file)
@@ -1993,6 +1993,7 @@ void client_update_strut(ObClient *self)
                               a->x, a->x + a->width - 1,
                               a->y, a->y + a->height - 1,
                               a->x, a->x + a->width - 1);
+            g_free(a);
         }
         g_free(data);
     }
@@ -2393,6 +2394,9 @@ gboolean client_has_parent(ObClient *self)
 static ObStackingLayer calc_layer(ObClient *self)
 {
     ObStackingLayer l;
+    Rect *monitor;
+
+    monitor = screen_physical_area_monitor(client_monitor(self));
 
     if (self->type == OB_CLIENT_TYPE_DESKTOP)
         l = OB_STACKING_LAYER_DESKTOP;
@@ -2406,15 +2410,15 @@ static ObStackingLayer calc_layer(ObClient *self)
               */
               (self->decorations == 0 &&
                !(self->max_horz && self->max_vert) &&
-               RECT_EQUAL(self->area,
-                          *screen_physical_area_monitor
-                          (client_monitor(self))))) &&
+               RECT_EQUAL(self->area, *monitor))) &&
              (client_focused(self) || client_search_focus_tree(self)))
         l = OB_STACKING_LAYER_FULLSCREEN;
     else if (self->above) l = OB_STACKING_LAYER_ABOVE;
     else if (self->below) l = OB_STACKING_LAYER_BELOW;
     else l = OB_STACKING_LAYER_NORMAL;
 
+    g_free(monitor);
+
     return l;
 }
 
@@ -2720,6 +2724,8 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h,
 
         user = FALSE; /* ignore if the client can't be moved/resized when it
                          is fullscreening */
+
+        g_free(a);
     } else if (self->max_horz || self->max_vert) {
         Rect *a;
         guint i;
index ff5b74cf9a34432d1cae4bffb30cfbdf8e901323..121565ac0cbfa1c57badc3e999403fb75c31e5e5 100644 (file)
@@ -522,6 +522,8 @@ void dock_configure()
     dock->h += ob_rr_theme->obwidth * 2;
 
     screen_update_areas();
+
+    g_free(a);
 }
 
 void dock_app_configure(ObDockApp *app, gint w, gint h)
index 581fa21587b33223a647eb0a91d3f6491cd55dca..463eb9be6b97cfb44d8c8396e2012f52e8912fb4 100644 (file)
@@ -433,6 +433,8 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
     RrPaint(p->a_text, p->text, textw, texth);
 
     p->last_target = newtarget;
+
+    g_free(screen_area);
 }
 
 void focus_cycle_popup_show(ObClient *c, gboolean iconic_windows,
@@ -511,6 +513,7 @@ void focus_cycle_popup_single_show(struct _ObClient *c,
         icon_popup_min_width(single_popup, POPUP_WIDTH);
         icon_popup_max_width(single_popup, MAX(a->width/3, POPUP_WIDTH));
         icon_popup_text_width(single_popup, popup.maxtextw);
+        g_free(a);
     }
 
     text = popup_get_name(c);
index 65d1404af9d11bb967c4fd05f35b5de0fb08c688..19ead3b991e4ff41d9380fbff31fe1f8997c5732 100644 (file)
@@ -1581,6 +1581,7 @@ static gboolean frame_animate_iconify(gpointer p)
         iconx = self->area.x + self->area.width / 2 + 32;
         icony = a->y + a->width;
         iconw = 64;
+        g_free(a);
     } else {
         iconx = self->client->icon_geometry.x;
         icony = self->client->icon_geometry.y;
index 9fd38def9452a03d1534cb3cef0a0ab2cedbcc47..7780753d4ff4435a5f19f5c84c64d14924e26284 100644 (file)
@@ -103,6 +103,7 @@ static void set_curpos(KeyBindingTree *newpos)
         /* 1 second delay for the popup to show */
         popup_delay_show(popup, G_USEC_PER_SEC, text);
         g_free(text);
+        g_free(a);
     } else {
         popup_hide(popup);
     }
index 6b3e729b0e0ed56868c1ca172d7bc6825880703c..4f5a34d8d095c2f5d460406c3194627f4a778296 100644 (file)
@@ -343,6 +343,8 @@ void menu_frame_move_on_screen(ObMenuFrame *self, gint x, gint y,
         *dx = MAX(*dx, a->x - x);
         *dy = MAX(*dy, a->y - y);
     }
+
+    g_free(a);
 }
 
 static void menu_entry_frame_render(ObMenuEntryFrame *self)
@@ -888,6 +890,8 @@ static void menu_frame_update(ObMenuFrame *self)
         }
     }
 
+    g_free(a);
+
     menu_frame_render(self);
 }
 
@@ -948,8 +952,10 @@ gboolean menu_frame_show_topmenu(ObMenuFrame *self, gint x, gint y,
 
     /* find the monitor the menu is on */
     for (i = 0; i < screen_num_monitors; ++i) {
-        Rect *a = screen_physical_area_monitor(i);
-        if (RECT_CONTAINS(*a, x, y)) {
+        Rect a = screen_physical_area_monitor(i);
+        gboolean contains = RECT_CONTAINS(*a, x, y);
+        g_free(a);
+        if (contains) {
             self->monitor = i;
             break;
         }
index 661226aeec05aaf71f9ea6d42b0cc7a312d5117d..2d14f5bd30ed9c7b54779aff2d59308fdfb42f1f 100644 (file)
@@ -45,10 +45,12 @@ static Rect *pick_pointer_head(ObClient *c)
 
     screen_pointer_pos(&px, &py);
      
-    for (i = 0; i < screen_num_monitors; ++i) {  
-        if (RECT_CONTAINS(*screen_physical_area_monitor(i), px, py)) {
+    for (i = 0; i < screen_num_monitors; ++i) {
+        Rect *monitor = screen_physical_area_monitor(i);
+        gboolean contain = RECT_CONTAINS(*monitor, px, py);
+        g_free(monitor);
+        if (contain)
             return screen_area_monitor(c->desktop, i, NULL);
-        }
     }
     g_assert_not_reached();
 }
@@ -111,7 +113,10 @@ static Rect **pick_head(ObClient *c)
     screen_pointer_pos(&px, &py);
 
     for (i = 0; i < screen_num_monitors; i++)
-        if (RECT_CONTAINS(*screen_physical_area_monitor(i), px, py)) {
+        Rect *monitor = screen_physical_area_monitor(i);
+        gboolean contain = RECT_CONTAINS(*monitor, px, py);
+        g_free(monitor);
+        if (contain)
             add_choice(choice, i);
             ob_debug("placement adding choice %d for mouse pointer\n", i);
             break;
index 77f751fcf888ba77be89c7b2facaf4c359906c1f..590c294666753c98ccd81a0b487f195029bef99a 100644 (file)
@@ -281,6 +281,8 @@ void popup_delay_show(ObPopup *self, gulong usec, gchar *text)
             popup_show_timeout(self);
         }
     }
+
+    g_free(area);
 }
 
 void popup_hide(ObPopup *self)
This page took 0.033866 seconds and 4 git commands to generate.