summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJess VanDerwalker <washu@sonic.net>2012-07-25 13:42:27 -0700
committerJess VanDerwalker <washu@sonic.net>2012-07-26 22:22:37 -0700
commitdae084822ed137c854599e25ab1a660e29b98e56 (patch)
tree5c3200a715aa8cf49be8f31d46c962c72d4780b9
parentd0224611012556ffc6bda9cef75b4e7371d0893d (diff)
libxcwm: Fix for build fail do to missing paren.
Missing paren was in memset statement for window sizing struct. Removed memset statement, moved memory allocation for xcwm_window_t sizing to xcwm_window_create() and changed to calloc to 0 fill xcwm_sizing_t structure. Properly freeing memory for window sizing struct in xcwm_window_release. Signed-off-by: Jess VanDerwalker <washu@sonic.net> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-rw-r--r--src/libxcwm/window.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libxcwm/window.c b/src/libxcwm/window.c
index bf6c70c..496f507 100644
--- a/src/libxcwm/window.c
+++ b/src/libxcwm/window.c
@@ -119,6 +119,8 @@ _xcwm_window_create(xcwm_context_t *context, xcb_window_t new_window,
assert(window->bounds);
window->dmg_bounds = malloc(sizeof(xcwm_rect_t));
assert(window->dmg_bounds);
+ window->sizing = calloc(1, sizeof(*window->sizing));
+ assert(window->dmg_bounds);;
xcb_get_geometry_reply_t *geom;
geom = _xcwm_get_window_geometry(context->conn, new_window);
@@ -298,6 +300,7 @@ _xcwm_window_release(xcwm_window_t *window)
}
free(window->bounds);
+ free(window->sizing);
if (window->dmg_bounds) {
free(window->dmg_bounds);
}
@@ -492,14 +495,9 @@ set_wm_size_hints_for_window(xcb_connection_t *conn, xcwm_window_t *window)
xcb_get_property_cookie_t cookie;
xcb_size_hints_t hints;
- if (window->sizing) {
- free(window->sizing);
- }
- window->sizing = malloc(sizeof(xcwm_window_sizing_t));
- assert(window->sizing);
cookie = xcb_icccm_get_wm_normal_hints(conn, window->window_id);
if (!xcb_icccm_get_wm_normal_hints_reply(conn, cookie, &hints, NULL)) {
- memset(window->sizing, 0, sizeof(*window->sizing);
+ /* Use 0 for all values (as set in calloc), or previous values */
return;
}
window->sizing->min_width = hints.min_width;