tbm_bo bo = NULL;
_tbm_bufmgr_mutex_lock();
- _tbm_set_last_result(TBM_ERROR_NONE);
TBM_BUFMGR_RETURN_VAL_IF_FAIL(TBM_BUFMGR_IS_VALID(bufmgr), NULL);
if (!bo) {
/* LCOV_EXCL_START */
TBM_ERR("memory allocationc failed.");
- _tbm_set_last_result(TBM_ERROR_OUT_OF_MEMORY);
+ *error = TBM_ERROR_OUT_OF_MEMORY;
+ _tbm_bufmgr_mutex_unlock();
+ return NULL;
/* LCOV_EXCL_STOP */
- goto fail;
}
bo->bo_data = tbm_module_alloc_bo_data_with_format(bufmgr->module, format, bo_idx, width, height, bpp, flags, error);
if (!bo->bo_data) {
/* LCOV_EXCL_START */
- _tbm_set_last_result(*error);
+ free(bo);
+ _tbm_bufmgr_mutex_unlock();
+ return NULL;
/* LCOV_EXCL_STOP */
- goto fail;
}
_tbm_bufmgr_initialize_bo(bufmgr, bo, flags);
_tbm_bufmgr_mutex_unlock();
return bo;
-
+/* LCOV_EXCL_START */
fail:
- if (bo)
- free(bo);
_tbm_bufmgr_mutex_unlock();
return NULL;
+/* LCOV_EXCL_STOP */
}
tbm_bo