mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-15 06:04:49 +01:00
Use HeapFree to free heaps, incorrectly used std free
Convert last malloc/free to HeapAlloc/HeapFree
This commit is contained in:
parent
fdf8395dd1
commit
afdc334935
@ -41,7 +41,7 @@ ULONG __stdcall ddraw_clipper_Release(IDirectDrawClipperImpl *This)
|
||||
|
||||
if(This->Ref == 0)
|
||||
{
|
||||
free(This);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ ULONG __stdcall ddraw_palette_Release(IDirectDrawPaletteImpl *This)
|
||||
|
||||
if(This->Ref == 0)
|
||||
{
|
||||
free(This);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
3
render.c
3
render.c
@ -129,11 +129,10 @@ DWORD WINAPI render_main(void)
|
||||
SetEvent(ddraw->render.ev);
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, tex);
|
||||
CloseHandle(ddraw->render.ev);
|
||||
ddraw->render.ev = NULL;
|
||||
|
||||
free(tex);
|
||||
|
||||
wglMakeCurrent(NULL, NULL);
|
||||
wglDeleteContext(hRC);
|
||||
ReleaseDC(ddraw->hWnd, hDC);
|
||||
|
@ -52,7 +52,7 @@ ULONG __stdcall ddraw_surface_Release(IDirectDrawSurfaceImpl *This)
|
||||
}
|
||||
if(This->surface)
|
||||
{
|
||||
free(This->surface);
|
||||
HeapFree(GetProcessHeap(), 0, This->surface);
|
||||
}
|
||||
if(This->palette)
|
||||
{
|
||||
@ -433,7 +433,7 @@ HRESULT __stdcall ddraw_CreateSurface(IDirectDrawImpl *This, LPDDSURFACEDESC lpD
|
||||
{
|
||||
Surface->lPitch = Surface->width;
|
||||
Surface->lXPitch = Surface->bpp / 8;
|
||||
Surface->surface = malloc(Surface->width * Surface->height * Surface->lXPitch);
|
||||
Surface->surface = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, Surface->width * Surface->height * Surface->lXPitch);
|
||||
}
|
||||
|
||||
printf(" Surface = %p (%dx%d@%d)\n", Surface, (int)Surface->width, (int)Surface->height, (int)Surface->bpp);
|
||||
|
Loading…
x
Reference in New Issue
Block a user