gdiplus: tidy up graphics constructor
Evan Stade
estade at gmail.com
Fri Jun 22 21:27:02 CDT 2007
Hi,
Changelog:
*added more error checking
*change HeapAlloc call to GdipAlloc call
dlls/gdiplus/graphics.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
--
Evan Stade
-------------- next part --------------
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index beba700..5ac16f7 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -116,8 +116,9 @@ GpStatus WINGDIPAPI GdipCreateFromHDC(HD
if(graphics == NULL)
return InvalidParameter;
- *graphics = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
- sizeof(GpGraphics));
+ *graphics = GdipAlloc(sizeof(GpGraphics));
+ if(!*graphics) return OutOfMemory;
+
(*graphics)->hdc = hdc;
(*graphics)->hwnd = NULL;
--
1.4.1
More information about the wine-patches
mailing list