[PATCH weston 04/12] shell: do not double-init a region

Pekka Paalanen ppaalanen at gmail.com
Wed Oct 10 02:49:26 PDT 2012


weston_surface_create() already inits the opaque region, so the second
init in create_black_surface() is logically wrong. Whether this was a
memory leak or not, depends on Pixman internals.

Fini before initing again.

Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
---
 src/shell.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/shell.c b/src/shell.c
index c799409..4600be3 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1632,6 +1632,7 @@ create_black_surface(struct weston_compositor *ec,
 	surface->private = fs_surface;
 	weston_surface_configure(surface, x, y, w, h);
 	weston_surface_set_color(surface, 0.0, 0.0, 0.0, 1);
+	pixman_region32_fini(&surface->opaque);
 	pixman_region32_init_rect(&surface->opaque, 0, 0, w, h);
 
 	return surface;
-- 
1.7.8.6



More information about the wayland-devel mailing list