d3drm: Fix child leak.

This commit is contained in:
Christian Costa 2012-10-21 14:51:25 +02:00 committed by Alexandre Julliard
parent ff0e82502f
commit 5e1d854ee5
1 changed files with 10 additions and 0 deletions

View File

@ -1260,6 +1260,7 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, LPDIRECTXFILEDATA pData)
if (FAILED(hr)) if (FAILED(hr))
{ {
hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileDataReference, (void **)&reference); hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileDataReference, (void **)&reference);
IDirectXFileObject_Release(child);
if (FAILED(hr)) if (FAILED(hr))
goto end; goto end;
@ -1268,6 +1269,10 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, LPDIRECTXFILEDATA pData)
if (FAILED(hr)) if (FAILED(hr))
goto end; goto end;
} }
else
{
IDirectXFileObject_Release(child);
}
hr = Direct3DRMMaterial_create(&material); hr = Direct3DRMMaterial_create(&material);
if (FAILED(hr)) if (FAILED(hr))
@ -1357,9 +1362,14 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, LPDIRECTXFILEDATA pData)
i++; i++;
} }
if (hr == S_OK) if (hr == S_OK)
{
IDirectXFileObject_Release(child);
WARN("Found more sub-objects than expected\n"); WARN("Found more sub-objects than expected\n");
}
else if (hr != DXFILEERR_NOMOREOBJECTS) else if (hr != DXFILEERR_NOMOREOBJECTS)
{
goto end; goto end;
}
hr = S_OK; hr = S_OK;
} }
else else