A buffer has to be unlocked after commit event so that the buffer can be
released immediately when unlocked by a compositor.
Change-Id: If7383a2432baf90df39f1457e3a3edf3bfcbac74
surface->role->commit(surface);
wl_signal_emit_mutable(&surface->events.commit, surface);
+
+ // Release the buffer after emitting the commit event, so that listeners
+ // can take full control over the buffer. Don't leave the buffer locked so
+ // that the buffer can be released immediately when unlocked by listeners.
+ if (surface->buffer) {
+ ds_buffer_unlock(surface->buffer);
+ surface->buffer = NULL;
+ }
}
void