d3drm: Release the child object after we're done with it in load_mesh_data() (Valgrind).
This commit is contained in:
parent
90239052ab
commit
23f0e97071
|
@ -1250,20 +1250,21 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3 *iface, IDirectXFileData *pData,
|
|||
IDirectXFileData *data;
|
||||
char **filename;
|
||||
|
||||
hr = IDirectXFileObject_QueryInterface(material_child, &IID_IDirectXFileData, (void **)&data);
|
||||
if (FAILED(hr))
|
||||
if (FAILED(hr = IDirectXFileObject_QueryInterface(material_child,
|
||||
&IID_IDirectXFileData, (void **)&data)))
|
||||
{
|
||||
IDirectXFileDataReference *reference;
|
||||
|
||||
hr = IDirectXFileObject_QueryInterface(material_child, &IID_IDirectXFileDataReference, (void **)&reference);
|
||||
if (FAILED(hr))
|
||||
goto end;
|
||||
|
||||
hr = IDirectXFileDataReference_Resolve(reference, &data);
|
||||
IDirectXFileDataReference_Release(reference);
|
||||
if (FAILED(hr))
|
||||
goto end;
|
||||
if (SUCCEEDED(IDirectXFileObject_QueryInterface(material_child,
|
||||
&IID_IDirectXFileDataReference, (void **)&reference)))
|
||||
{
|
||||
hr = IDirectXFileDataReference_Resolve(reference, &data);
|
||||
IDirectXFileDataReference_Release(reference);
|
||||
}
|
||||
}
|
||||
IDirectXFileObject_Release(material_child);
|
||||
if (FAILED(hr))
|
||||
goto end;
|
||||
|
||||
hr = IDirectXFileData_GetType(data, &guid);
|
||||
if (hr != DXFILE_OK)
|
||||
|
@ -1308,6 +1309,7 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3 *iface, IDirectXFileData *pData,
|
|||
}
|
||||
}
|
||||
}
|
||||
IDirectXFileData_Release(data);
|
||||
}
|
||||
else if (hr != DXFILEERR_NOMOREOBJECTS)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue