Commit 21218c85 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

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

parent fe2becae
......@@ -1459,13 +1459,20 @@ IWineGDISurfaceImpl_PrivateSetup(IWineD3DSurface *iface)
HRESULT hr;
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 */
This->resource.size = This->currentDesc.Width * D3DFmtGetBpp(This->resource.wineD3DDevice, This->resource.format) * This->currentDesc.Width;
This->pow2Size = This->resource.size;
This->pow2Width = This->currentDesc.Width;
This->pow2Height = This->currentDesc.Height;
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
*
* Release the DC afterwards to allow the app to use it
......
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