mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-17 23:00:07 +00:00
win32: ensure proper error is reported when CreateDIBSection() fails
GetLastError() should be called immediately after the failure, so call WIN32_GDI_FAILED() just after the CreateDIBSection() error, not after ReleaseDC(). https://bugzilla.gnome.org/show_bug.cgi?id=698563
This commit is contained in:
parent
330b9635b0
commit
0df60513cb
@ -293,15 +293,15 @@ _gdk_pixmap_new (GdkDrawable *drawable,
|
||||
bmi.u.bmiMasks[1] = visual->green_mask;
|
||||
bmi.u.bmiMasks[2] = visual->blue_mask;
|
||||
|
||||
hbitmap = CreateDIBSection (hdc, (BITMAPINFO *) &bmi,
|
||||
iUsage, (PVOID *) &bits, NULL, 0);
|
||||
GDI_CALL (ReleaseDC, (hwnd, hdc));
|
||||
if (hbitmap == NULL)
|
||||
if ((hbitmap = CreateDIBSection (hdc, (BITMAPINFO *) &bmi,
|
||||
iUsage, (PVOID *) &bits, NULL, 0)) == NULL)
|
||||
{
|
||||
WIN32_GDI_FAILED ("CreateDIBSection");
|
||||
GDI_CALL (ReleaseDC, (hwnd, hdc));
|
||||
g_object_unref ((GObject *) pixmap);
|
||||
return NULL;
|
||||
}
|
||||
GDI_CALL (ReleaseDC, (hwnd, hdc));
|
||||
|
||||
dib_surface = cairo_image_surface_create_for_data (bits,
|
||||
format, width, height,
|
||||
|
Loading…
Reference in New Issue
Block a user