wined3d: Don't keep a reference to the container, as it creates a
circular reference.
This commit is contained in:
parent
0ff18f58fa
commit
7a4b59b0c2
|
@ -69,9 +69,6 @@ ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface) {
|
||||||
glDeleteTextures(1, &This->glDescription.textureName);
|
glDeleteTextures(1, &This->glDescription.textureName);
|
||||||
LEAVE_GL();
|
LEAVE_GL();
|
||||||
}
|
}
|
||||||
if (This->container) {
|
|
||||||
IWineD3DBase_Release(This->container);
|
|
||||||
}
|
|
||||||
IWineD3DResourceImpl_CleanUp((IWineD3DResource *)iface);
|
IWineD3DResourceImpl_CleanUp((IWineD3DResource *)iface);
|
||||||
|
|
||||||
TRACE("(%p) Released\n", This);
|
TRACE("(%p) Released\n", This);
|
||||||
|
@ -1357,12 +1354,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetContainer(IWineD3DSurface *iface, IWineD3D
|
||||||
|
|
||||||
TRACE("This %p, container %p\n", This, container);
|
TRACE("This %p, container %p\n", This, container);
|
||||||
|
|
||||||
if (container) {
|
/* We can't keep a reference to the container, since the container already keeps a reference to us. */
|
||||||
IWineD3DBase_AddRef(container);
|
|
||||||
}
|
|
||||||
if (This->container) {
|
|
||||||
IWineD3DBase_Release(This->container);
|
|
||||||
}
|
|
||||||
|
|
||||||
TRACE("Setting container to %p from %p\n", container, This->container);
|
TRACE("Setting container to %p from %p\n", container, This->container);
|
||||||
This->container = container;
|
This->container = container;
|
||||||
|
|
|
@ -55,9 +55,6 @@ ULONG WINAPI IWineD3DVolumeImpl_Release(IWineD3DVolume *iface) {
|
||||||
TRACE("(%p) : Releasing from %ld\n", This, This->resource.ref);
|
TRACE("(%p) : Releasing from %ld\n", This, This->resource.ref);
|
||||||
ref = InterlockedDecrement(&This->resource.ref);
|
ref = InterlockedDecrement(&This->resource.ref);
|
||||||
if (ref == 0) {
|
if (ref == 0) {
|
||||||
if (This->container) {
|
|
||||||
IWineD3DBase_Release(This->container);
|
|
||||||
}
|
|
||||||
IWineD3DResourceImpl_CleanUp((IWineD3DResource *)iface);
|
IWineD3DResourceImpl_CleanUp((IWineD3DResource *)iface);
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
@ -252,12 +249,7 @@ HRESULT WINAPI IWineD3DVolumeImpl_SetContainer(IWineD3DVolume *iface, IWineD3DBa
|
||||||
|
|
||||||
TRACE("This %p, container %p\n", This, container);
|
TRACE("This %p, container %p\n", This, container);
|
||||||
|
|
||||||
if (container) {
|
/* We can't keep a reference to the container, since the container already keeps a reference to us. */
|
||||||
IWineD3DBase_AddRef(container);
|
|
||||||
}
|
|
||||||
if (This->container) {
|
|
||||||
IWineD3DBase_Release(This->container);
|
|
||||||
}
|
|
||||||
|
|
||||||
TRACE("Setting container to %p from %p\n", container, This->container);
|
TRACE("Setting container to %p from %p\n", container, This->container);
|
||||||
This->container = container;
|
This->container = container;
|
||||||
|
|
Loading…
Reference in New Issue