surface->height = height;
surface->buffer = NULL;
+ surface->output = NULL;
pixman_region32_init(&surface->damage);
pixman_region32_init(&surface->opaque);
cb->resource.destroy = destroy_frame_callback;
cb->resource.client = client;
cb->resource.data = cb;
- wl_list_insert(es->output->frame_callback_list.prev, &cb->link);
wl_client_add_resource(client, &cb->resource);
+
+ if (es->output) {
+ wl_list_insert(es->output->frame_callback_list.prev,
+ &cb->link);
+ } else {
+ wl_list_init(&cb->link);
+ wl_resource_destroy(&cb->resource, 0);
+ }
}
const static struct wl_surface_interface surface_interface = {