wined3d: Don't keep a reference to the container, as it creates a

circular reference.
This commit is contained in:
H. Verbeet 2006-02-13 13:23:58 +01:00 committed by Alexandre Julliard
parent 0ff18f58fa
commit 7a4b59b0c2
2 changed files with 2 additions and 18 deletions

View File

@ -69,9 +69,6 @@ ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface) {
glDeleteTextures(1, &This->glDescription.textureName);
LEAVE_GL();
}
if (This->container) {
IWineD3DBase_Release(This->container);
}
IWineD3DResourceImpl_CleanUp((IWineD3DResource *)iface);
TRACE("(%p) Released\n", This);
@ -1357,12 +1354,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetContainer(IWineD3DSurface *iface, IWineD3D
TRACE("This %p, container %p\n", This, container);
if (container) {
IWineD3DBase_AddRef(container);
}
if (This->container) {
IWineD3DBase_Release(This->container);
}
/* We can't keep a reference to the container, since the container already keeps a reference to us. */
TRACE("Setting container to %p from %p\n", container, This->container);
This->container = container;

View File

@ -55,9 +55,6 @@ ULONG WINAPI IWineD3DVolumeImpl_Release(IWineD3DVolume *iface) {
TRACE("(%p) : Releasing from %ld\n", This, This->resource.ref);
ref = InterlockedDecrement(&This->resource.ref);
if (ref == 0) {
if (This->container) {
IWineD3DBase_Release(This->container);
}
IWineD3DResourceImpl_CleanUp((IWineD3DResource *)iface);
HeapFree(GetProcessHeap(), 0, This);
}
@ -252,12 +249,7 @@ HRESULT WINAPI IWineD3DVolumeImpl_SetContainer(IWineD3DVolume *iface, IWineD3DBa
TRACE("This %p, container %p\n", This, container);
if (container) {
IWineD3DBase_AddRef(container);
}
if (This->container) {
IWineD3DBase_Release(This->container);
}
/* We can't keep a reference to the container, since the container already keeps a reference to us. */
TRACE("Setting container to %p from %p\n", container, This->container);
This->container = container;