Hi
IDirect3DTexure9::Release { ULONG ref = This->ref--;
if(ref == 0) { for(all surfaces in this container) { surfaceImpl->container = NULL; /* Or place this call in WineD3DTexture::Releaase*/
IWineD3DTexture_Release(This->wineD3DTexture); /* IWineD3DTexture_Release will call the release method * of the IDirect3D9Surface(because it releases the parent), * run the surface's release code(not the container, because * it's set to NULL and destroy the surface, because it's own * refcount is 1 from creation, and we never changed it. * The D3D9 surface release code releases the wineD3DSurface, * and everthing is cleaned. */
HeapFree(GetProcessHeap, 0, This); } } }
Oops, little problem here: That should be
IDirect3DTexure9::Release { ULONG ref = This->ref--; if(ref == 0) { for(all surfaces in this container) { surfaceImpl->container = NULL; /* Don't free the objects in this loop of course ;) */ }
/* Or place this call in WineD3DTexture::Releaase*/ IWineD3DTexture_Release(This->wineD3DTexture);
/* IWineD3DTexture_Release will call the release method * of the IDirect3D9Surface(because it releases the parent), * run the surface's release code(not the container, because * it's set to NULL and destroy the surface, because it's own * refcount is 1 from creation, and we never changed it. * The D3D9 surface release code releases the wineD3DSurface, * and everthing is cleaned. */ HeapFree(GetProcessHeap, 0, This); } }