int pending_cnt = 0;
tpl_list_node_t *node = NULL;
+ tpl_list_node_t *next = NULL;
tpl_bool_t ret = TPL_TRUE;
tpl_gmutex_lock(&wl_egl_surface->surf_mutex);
do {
if (!node) break;
+ /* store the next node before node is freed */
+ next = __tpl_list_node_next(node);
+
tpl_wl_egl_buffer_t wl_egl_buffer(__tpl_list_node_get_data(node));
tpl_gmutex_lock(&wl_egl_buffer->mutex);
status_to_string[status],
status_to_string[RELEASED]);
- wl_egl_buffer->status = RELEASED;
+ wl_egl_buffer->status = RELEASED;
tpl_gmutex_unlock(&wl_egl_buffer->mutex);
tbm_surface_internal_unref(wl_egl_buffer->tbm_surface);
- } while ((node = __tpl_list_node_next(node)));
+ } while ((node = next));
tpl_gmutex_rec_unlock(&wl_egl_surface->buffers_mutex);