TBM_RETURN_VAL_IF_FAIL(formats, 0);
TBM_RETURN_VAL_IF_FAIL(num, 0);
- struct _tbm_bufmgr *mgr;
+ struct _tbm_bufmgr *bufmgr;
int ret = 0;
bool bufmgr_initialized = false;
bufmgr_initialized = true;
}
- mgr = g_surface_bufmgr;
+ bufmgr = g_surface_bufmgr;
- if (!mgr->backend->surface_supported_format)
+ if (!bufmgr->backend->surface_supported_format)
goto fail;
- ret = mgr->backend->surface_supported_format(formats, num);
+ ret = bufmgr->backend->surface_supported_format(formats, num);
if (!ret) {
/* LCOV_EXCL_START */
TBM_LOG_E("Fail to surface_supported_format.\n");
TBM_TRACE("tbm_bufmgr(%p) format num(%u)\n", g_surface_bufmgr, *num);
+ if (bufmgr_initialized) {
+ LIST_DELINIT(&g_surface_bufmgr->surf_list);
+ _deinit_surface_bufmgr();
+ }
+
_tbm_surface_mutex_unlock();
return ret;