surface->refcnt--;
- if (surface->refcnt > 0)
+ if (surface->refcnt > 0) {
+ _tbm_surface_mutex_unlock();
return;
+ }
if (surface->refcnt == 0)
_tbm_surface_internal_destroy(surface);
void
tbm_surface_internal_ref (tbm_surface_h surface)
{
- _tbm_surface_mutex_lock();
-
TBM_RETURN_IF_FAIL (surface);
_tbm_surface_mutex_lock();
void
tbm_surface_internal_unref (tbm_surface_h surface)
{
- _tbm_surface_mutex_lock();
-
TBM_RETURN_IF_FAIL (surface);
+ _tbm_surface_mutex_lock();
+
surface->refcnt--;
- if (surface->refcnt > 0)
+ if (surface->refcnt > 0) {
+ _tbm_surface_mutex_unlock();
return;
+ }
if (surface->refcnt == 0)
_tbm_surface_internal_destroy(surface);