_wayland_tbm_server_destroy_resource(struct wl_resource *wl_tbm)
{
struct wayland_tbm_server *tbm_srv;
+ struct wayland_tbm_client_queue *cqueue = NULL;
#ifdef DEBUG_TRACE
pid_t pid;
if (!tbm_srv)
return;
+ wl_list_for_each(cqueue, &tbm_srv->cqueue_list, link) {
+ if (cqueue && cqueue->wl_tbm == wl_tbm)
+ cqueue->wl_tbm = NULL;
+ }
+
/* remove the queue resources */
// TODO:
}
WL_TBM_RETURN_VAL_IF_FAIL(wl_surface != NULL, NULL);
wl_list_for_each(cqueue, &tbm_srv->cqueue_list, link) {
- if (cqueue && cqueue->wl_surface == wl_surface)
+ if (cqueue && cqueue->wl_tbm && cqueue->wl_surface == wl_surface)
return cqueue;
}
WL_TBM_RETURN_VAL_IF_FAIL(cqueue != NULL, NULL);
WL_TBM_RETURN_VAL_IF_FAIL(cqueue->wl_tbm_queue != NULL, NULL);
+ WL_TBM_RETURN_VAL_IF_FAIL(cqueue->wl_tbm != NULL, NULL);
WL_TBM_RETURN_VAL_IF_FAIL(surface != NULL, NULL);
wl_tbm = cqueue->wl_tbm;