wined3d: Release the memory in IWineGDISurface::PrivateSetup before calling GetDC.

This commit is contained in:
Stefan Dösinger 2006-05-29 10:53:43 +02:00 committed by Alexandre Julliard
parent fe2becaee3
commit 21218c8587
1 changed files with 8 additions and 1 deletions

View File

@ -1459,13 +1459,20 @@ IWineGDISurfaceImpl_PrivateSetup(IWineD3DSurface *iface)
HRESULT hr; HRESULT hr;
HDC hdc; HDC hdc;
/* Sysmem textures have memory already allocated -
* release it, this avoids an unnecessary memcpy
*/
HeapFree(GetProcessHeap(), 0, This->resource.allocatedMemory);
This->resource.allocatedMemory = NULL;
/* We don't mind the nonpow2 stuff in GDI */ /* We don't mind the nonpow2 stuff in GDI */
This->resource.size = This->currentDesc.Width * D3DFmtGetBpp(This->resource.wineD3DDevice, This->resource.format) * This->currentDesc.Width;
This->pow2Size = This->resource.size; This->pow2Size = This->resource.size;
This->pow2Width = This->currentDesc.Width; This->pow2Width = This->currentDesc.Width;
This->pow2Height = This->currentDesc.Height; This->pow2Height = This->currentDesc.Height;
This->Flags &= ~SFLAG_NONPOW2; This->Flags &= ~SFLAG_NONPOW2;
/* Call GetDC to create a DIB section. We will use that /* Call GetDC to create a DIB section. We will use that
* DIB section for rendering * DIB section for rendering
* *
* Release the DC afterwards to allow the app to use it * Release the DC afterwards to allow the app to use it