commit | 74268d34f203ff5d71dd59334ffc6534f2259375 | [log] [tgz] |
---|---|---|
author | Felipe Heidrich <fheidric> | Tue Sep 29 20:47:13 2009 +0000 |
committer | Felipe Heidrich <fheidric> | Tue Sep 29 20:47:13 2009 +0000 |
tree | ec791b2d5232b2673450b8ca4a5e995730652a3e | |
parent | 8eddb2cca71a24fffdbe71d95682980c5888de2d [diff] |
3.5.2 - Bug 288857: GDI Handle Resource Leak
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java index d4701a1..e0aaf15 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
@@ -731,7 +731,9 @@ if (hFont != lastHFont) { lastHFont = hFont; if (gdipFont != 0) Gdip.Font_delete(gdipFont); + int /*long*/ oldFont = OS.SelectObject(hdc, hFont); gdipFont = Gdip.Font_new(hdc, hFont); + OS.SelectObject(hdc, oldFont); if (gdipFont == 0) SWT.error(SWT.ERROR_NO_HANDLES); if (!Gdip.Font_IsAvailable(gdipFont)) { Gdip.Font_delete(gdipFont);