tpl_gmutex_lock(&wl_egl_surface->surf_mutex);
if (wl_egl_surface->reset == TPL_TRUE &&
tbm_surface_internal_is_valid(wl_egl_surface->last_enq_buffer)) {
+ tbm_surface_h last_enq_buffer = wl_egl_surface->last_enq_buffer;
tpl_wl_egl_buffer_t *enqueued_buffer =
- _get_wl_egl_buffer(wl_egl_surface->last_enq_buffer);
+ _get_wl_egl_buffer(last_enq_buffer);
if (enqueued_buffer) {
- tbm_surface_internal_ref(wl_egl_surface->last_enq_buffer);
+ tbm_surface_internal_ref(last_enq_buffer);
tpl_gmutex_unlock(&wl_egl_surface->surf_mutex);
tpl_gmutex_lock(&enqueued_buffer->mutex);
while (enqueued_buffer->status >= ENQUEUED &&
}
tpl_gmutex_unlock(&enqueued_buffer->mutex);
tpl_gmutex_lock(&wl_egl_surface->surf_mutex);
- tbm_surface_internal_unref(wl_egl_surface->last_enq_buffer);
+ tbm_surface_internal_unref(last_enq_buffer);
}
wl_egl_surface->last_enq_buffer = NULL;
wl_egl_buffer->need_to_commit = TPL_FALSE;
wl_egl_buffer->status = COMMITTED;
+ if (wl_egl_surface->last_enq_buffer == wl_egl_buffer->tbm_surface)
+ wl_egl_surface->last_enq_buffer = NULL;
tpl_gcond_signal(&wl_egl_buffer->cond);