On 6/14/20 3:56 PM, Gijs Vermeulen wrote:
- if (FAILED(hr = D3DXCreateSkinInfo(skin->num_vertices, skin->vertex_declaration, skin->num_bones, skin_info)))
return hr;
- for (i = 0; i < skin->num_bones; ++i)
- {
struct bone *current_bone = &skin->bones[i];
if (current_bone->name && FAILED(hr = (*skin_info)->lpVtbl->SetBoneName(*skin_info, i, current_bone->name)))
return hr;
if (¤t_bone->transform
&& FAILED(hr = (*skin_info)->lpVtbl->SetBoneOffsetMatrix(*skin_info, i, ¤t_bone->transform)))
return hr;
if (current_bone->vertices && current_bone->weights
&& FAILED(hr = (*skin_info)->lpVtbl->SetBoneInfluence(*skin_info, i, current_bone->num_influences,
current_bone->vertices, current_bone->weights)))
return hr;
- }
- return hr;
Hi, Gijs.
This will leak your partially initialized object on error paths.