compositor: free regions in wlsc_output_repaint()
authorPekka Paalanen <ppaalanen@gmail.com>
Mon, 2 Jan 2012 13:42:44 +0000 (15:42 +0200)
committerPekka Paalanen <ppaalanen@gmail.com>
Mon, 2 Jan 2012 13:42:44 +0000 (15:42 +0200)
Some of the local pixman region objects were not being properly
destroyed before returning from the function. Destroy them, fixes
some Valgrind errors.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
compositor/compositor.c

index 06ee7f3..c4ab9db 100644 (file)
@@ -765,7 +765,7 @@ wlsc_output_repaint(struct wlsc_output *output)
 
        pixman_region32_init(&new_damage);
        pixman_region32_init(&opaque);
-                               
+
        wl_list_for_each(es, &ec->surface_list, link) {
                pixman_region32_subtract(&es->damage, &es->damage, &opaque);
                pixman_region32_union(&new_damage, &new_damage, &es->damage);
@@ -805,11 +805,14 @@ wlsc_output_repaint(struct wlsc_output *output)
                        wlsc_surface_draw(es, output, &repaint);
                        pixman_region32_subtract(&es->damage,
                                                 &es->damage, &output->region);
+                       pixman_region32_fini(&repaint);
                }
        }
 
        if (ec->fade.spring.current > 0.001)
                fade_output(output, ec->fade.spring.current, &total_damage);
+
+       pixman_region32_fini(&total_damage);
 }
 
 struct wlsc_frame_callback {