shell: do not double-init a region
authorPekka Paalanen <ppaalanen@gmail.com>
Wed, 10 Oct 2012 09:49:26 +0000 (12:49 +0300)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 11 Oct 2012 01:38:35 +0000 (21:38 -0400)
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@gmail.com>
src/shell.c

index c799409..4600be3 100644 (file)
@@ -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;