Commit 7a4b59b0 authored by H. Verbeet's avatar H. Verbeet Committed by Alexandre Julliard

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

circular reference.
parent 0ff18f58
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment