mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-09-30 02:57:38 +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[1] = visual->green_mask;
|
||||||
bmi.u.bmiMasks[2] = visual->blue_mask;
|
bmi.u.bmiMasks[2] = visual->blue_mask;
|
||||||
|
|
||||||
hbitmap = CreateDIBSection (hdc, (BITMAPINFO *) &bmi,
|
if ((hbitmap = CreateDIBSection (hdc, (BITMAPINFO *) &bmi,
|
||||||
iUsage, (PVOID *) &bits, NULL, 0);
|
iUsage, (PVOID *) &bits, NULL, 0)) == NULL)
|
||||||
GDI_CALL (ReleaseDC, (hwnd, hdc));
|
|
||||||
if (hbitmap == NULL)
|
|
||||||
{
|
{
|
||||||
WIN32_GDI_FAILED ("CreateDIBSection");
|
WIN32_GDI_FAILED ("CreateDIBSection");
|
||||||
|
GDI_CALL (ReleaseDC, (hwnd, hdc));
|
||||||
g_object_unref ((GObject *) pixmap);
|
g_object_unref ((GObject *) pixmap);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
GDI_CALL (ReleaseDC, (hwnd, hdc));
|
||||||
|
|
||||||
dib_surface = cairo_image_surface_create_for_data (bits,
|
dib_surface = cairo_image_surface_create_for_data (bits,
|
||||||
format, width, height,
|
format, width, height,
|
||||||
|
Loading…
Reference in New Issue
Block a user