`view->surface` had not been set to a non-`NULL` value here, so it
was not yet appropriate to access its `resource` member. instead,
use the resource from the argument xdg_surface.
furthermore, we need to free the newly-allocated `xdg_toplevel_view`
before error return.
view->scene_tree, xdg_surface);
if (!tree) {
/* TODO: might need further clean up */
- wl_resource_post_no_memory(view->surface->resource);
+ wl_resource_post_no_memory(xdg_surface->resource);
+ free(xdg_toplevel_view);
return;
}
view->scene_node = &tree->node;