swc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/swc
Log | Files | Refs | README | LICENSE

commit 08ad563acfb4351df25d03df725455e47d17d691
parent 268b3384b7c5cb846f539e294ac9ee2469188156
Author: Michael Forney <mforney@mforney.org>
Date:   Tue, 21 Jan 2014 18:12:10 -0800

Fix some memory leaks

Diffstat:
Mlibswc/compositor.c | 1+
Mlibswc/framebuffer_plane.c | 1+
Mlibswc/screen.c | 2+-
Mlibswc/wayland_buffer.c | 2++
Mlibswc/window.c | 2++
Mlibswc/xwm.c | 4++++
6 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/libswc/compositor.c b/libswc/compositor.c @@ -735,6 +735,7 @@ static void update_screen(struct swc_screen_internal * base) pixman_region32_translate(&damage, -geometry->x, -geometry->y); pixman_region32_union(&screen->next_buffer->damage, &screen->next_buffer->damage, &damage); + pixman_region32_fini(&damage); /* Don't repaint the screen if it is waiting for a page flip. */ if (compositor.pending_flips & swc_screen_mask(base)) diff --git a/libswc/framebuffer_plane.c b/libswc/framebuffer_plane.c @@ -206,6 +206,7 @@ bool swc_framebuffer_plane_initialize(struct swc_framebuffer_plane * plane, void swc_framebuffer_plane_finalize(struct swc_framebuffer_plane * plane) { + wl_array_release(&plane->connectors); drmModeCrtcPtr crtc = plane->original_crtc_state; drmModeSetCrtc(swc.drm->fd, crtc->crtc_id, crtc->buffer_id, crtc->x, crtc->y, NULL, 0, &crtc->mode); diff --git a/libswc/screen.c b/libswc/screen.c @@ -51,7 +51,7 @@ void swc_screens_finalize() struct swc_screen_internal * screen, * tmp; wl_list_for_each_safe(screen, tmp, &swc.screens, link) - free(screen); + swc_screen_destroy(screen); } struct swc_screen_internal * swc_screen_new(uint32_t crtc, diff --git a/libswc/wayland_buffer.c b/libswc/wayland_buffer.c @@ -54,6 +54,7 @@ static void handle_buffer_destroy(struct wl_listener * listener, void * data) = CONTAINER_OF(listener, typeof(*buffer), destroy_listener); swc_buffer_finalize(&buffer->base); + free(buffer); } static inline uint32_t format_shm_to_wld(uint32_t format) @@ -132,6 +133,7 @@ static void destroy_buffer(struct wl_resource * resource) struct wayland_buffer * buffer = wl_resource_get_user_data(resource); swc_buffer_finalize(&buffer->base); + free(buffer); } struct swc_buffer * swc_wayland_buffer_new diff --git a/libswc/window.c b/libswc/window.c @@ -139,6 +139,8 @@ void swc_window_finalize(struct swc_window * window) swc_send_event(&window->event_signal, SWC_WINDOW_DESTROYED, NULL); swc_compositor_remove_surface(INTERNAL(window)->surface); INTERNAL(window)->surface->window = NULL; + free(window->title); + free(window->class); } void swc_window_set_title(struct swc_window * window, diff --git a/libswc/xwm.c b/libswc/xwm.c @@ -68,6 +68,8 @@ static void update_name(struct xwl_window * xwl_window) swc_window_set_title(&xwl_window->window.base, wm_name_reply.strings, wm_name_reply.strings_len); + + xcb_ewmh_get_utf8_strings_reply_wipe(&wm_name_reply); } static struct xwl_window_entry * find_window(xcb_window_t id) @@ -154,6 +156,7 @@ static int connection_data(int fd, uint32_t mask, void * data) property_notify((xcb_property_notify_event_t *) event); } + free(event); ++count; } @@ -343,6 +346,7 @@ void swc_xwm_manage_window(xcb_window_t id, struct swc_surface * surface) geometry_cookie, NULL))) { swc_view_move(surface->view, geometry_reply->x, geometry_reply->y); + free(geometry_reply); } if (entry->override_redirect)