tbm_surface_internal: set an error when the refcnt of a surface is less than 0 39/257739/1
authorSooChan Lim <sc1.lim@samsung.com>
Thu, 29 Apr 2021 07:49:23 +0000 (16:49 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 29 Apr 2021 07:51:53 +0000 (16:51 +0900)
Only at TW3, we can watch that the refcnt of a surface is less than 0
when we run tbm-haltests all.

Change-Id: I614c48c412783bbbe7a21cca905da3440e7057f0

src/tbm_surface_internal.c

index 79f94a6..90e5222 100644 (file)
@@ -1139,6 +1139,8 @@ tbm_surface_internal_destroy(tbm_surface_h surface)
 
        if (surface->refcnt == 0)
                _tbm_surface_internal_destroy(surface);
+       else // if (surface->refcnt < 0)
+               _tbm_set_last_result(TBM_ERROR_INVALID_PARAMETER);
 
        _tbm_surface_mutex_unlock();
 }