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 364514 - gtk leaks GDI objects on the win32 classic look and feel
gtk leaks GDI objects on the win32 classic look and feel
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.10.x
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
: 364594 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-10-23 19:29 UTC by Alex Converse
Modified: 2006-10-24 01:38 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alex Converse 2006-10-23 19:29:06 UTC
gtk+ leaks GDI objects on minimize/restore among other behaviors under the classic windows theme on windows XP. Another user experiences the same behavior using win 2k.

Steps:
1) Launch taskmanger
2) Configure task manager ti show GDI object count
3) launch gtk-demo.exe
4) minimize and restore the window repeatedly to watch th4e GDI object count slowly rise
5) play around with gtk demo and watch the count rise
Comment 1 Daniel Beardsmore 2006-10-23 19:40:27 UTC
Repeatable under Windows 2000. GDI object leaks accrue rapidly if you scroll
the left hand pane of the demo app quite fast. Other sources of leaks include
menus in GTK+ applications so the problem is quite fundamental.

A GTK+ app can reach 10,000 GDI items leaked in well under 24 hours and fall
apart, triggering a crash in Cairo.

These debug lines may also be seen after too much leakage has occurred:

(04:55:10) Gdk: gdkdrawable-win32.c:1313: LineTo failed: The operation
completed successfully.
(04:55:10) Gdk: gdkgc-win32.c:846: SaveDC failed: Not enough storage is
available to process this command.
(04:55:10) Gdk: gdkgc-win32.c:986: RestoreDC failed: The parameter is
incorrect.
Comment 2 Tor Lillqvist 2006-10-23 20:02:10 UTC
Sorry, I can't reproduce with gtk+ 2.10.6, pango 1.14.5, glib 2.12.4. No matter how much I minimize and restore gtk-demo, the GDI Object count stays at 66. Ditto if I scroll the left-hand pane up and down.

Hmm, that is without using any gtk+ theme. If I use the ms-windows theme, I do see the GDI Object count increasing as you say. Thus, as a workaround, don't use the ms-windows theme.
Comment 3 Dominic Lachowicz 2006-10-23 20:30:59 UTC
This was related to the improvements in bug 340201. Some CreatePen() calls don't seem to be paired with DeleteObject() calls. I think that it's limited to draw_expander() in msw_style.c. It was a 1 line of code fix.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/pens_9wha.asp

FIXED in the CVS HEAD, 2-10, and 2-8 branches, since I'm not entirely sure what packagers are shipping these days.
Comment 4 Dominic Lachowicz 2006-10-24 01:38:01 UTC
*** Bug 364594 has been marked as a duplicate of this bug. ***