After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 699236 - Assert triggered during gdk_pixmap_new() if some failure happens
Assert triggered during gdk_pixmap_new() if some failure happens
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.24.x
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-04-29 16:01 UTC by Aleksander Morgado
Modified: 2013-08-14 08:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch. (2.10 KB, patch)
2013-04-29 16:02 UTC, Aleksander Morgado
committed Details | Review

Description Aleksander Morgado 2013-04-29 16:01:03 UTC
If for some reason gdk_pixmap_new() fails (e.g. CreateDIBSection() fails), we end up g_object_unref()-ing the temporary GdkPixmap we created and this triggers an assert in GdkDrawable's finalize:

Gdk:ERROR:gdkdrawable-win32.c:2047:_gdk_win32_drawable_finish: assertion failed: (impl->hdc_count == 0)

Easily reproducible, just by doing:

  /* Invalid sizes for pixmap, and depth=16 to
   * trigger CreateDIBSection() */
  pixmap = gdk_pixmap_new (NULL, -1, -1, 16);
Comment 1 Aleksander Morgado 2013-04-29 16:02:21 UTC
Created attachment 242821 [details] [review]
Patch.
Comment 2 Matthias Clasen 2013-08-13 22:51:42 UTC
Review of attachment 242821 [details] [review]:

looks reasonable
Comment 3 Aleksander Morgado 2013-08-14 08:41:54 UTC
Pushed to gtk-2-24.