compositor-x11: implement x11_output_destroy()
authorPekka Paalanen <ppaalanen@gmail.com>
Tue, 3 Jan 2012 09:51:03 +0000 (11:51 +0200)
committerPekka Paalanen <ppaalanen@gmail.com>
Tue, 3 Jan 2012 14:16:28 +0000 (16:16 +0200)
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
compositor/compositor-x11.c

index 5aa1ebf..b2f4a7b 100644 (file)
@@ -225,7 +225,20 @@ x11_output_set_cursor(struct wlsc_output *output_base,
 static void
 x11_output_destroy(struct wlsc_output *output_base)
 {
-       return;
+       struct x11_output *output = (struct x11_output *)output_base;
+       struct x11_compositor *compositor =
+               (struct x11_compositor *)output->base.compositor;
+
+       wl_list_remove(&output->base.link);
+       wl_event_source_remove(output->finish_frame_timer);
+
+       eglDestroySurface(compositor->base.display, output->egl_surface);
+
+       xcb_destroy_window(compositor->conn, output->window);
+
+       wlsc_output_destroy(&output->base);
+
+       free(output);
 }
 
 static void