diff dwt/graphics/Font.d @ 334:c49e17d48b76

Fix problems at GC run at main()'s end.
author Frank Benoit <benoit@tionex.de>
date Wed, 18 Feb 2009 16:14:31 +0100
parents fd9c62a2998e
children
line wrap: on
line diff
--- a/dwt/graphics/Font.d	Tue Feb 10 17:14:24 2009 +0100
+++ b/dwt/graphics/Font.d	Wed Feb 18 16:14:31 2009 +0100
@@ -12,7 +12,6 @@
  *******************************************************************************/
 module dwt.graphics.Font;
 
-
 import dwt.DWT;
 import dwt.DWTError;
 import dwt.DWTException;
@@ -195,9 +194,9 @@
  */
 public FontData[] getFontData() {
     if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
-    LOGFONT* logFont = new LOGFONT();
-    OS.GetObject(handle, LOGFONT.sizeof, logFont);
-    return [ cast(FontData) FontData.win32_new(logFont, device.computePoints(logFont, handle))];
+    LOGFONT logFont;
+    OS.GetObject(handle, LOGFONT.sizeof, &logFont);
+    return [ cast(FontData) FontData.win32_new(&logFont, device.computePoints(&logFont, handle))];
 }
 
 /**
@@ -247,6 +246,12 @@
 override public String toString () {
     if (isDisposed()) return "Font {*DISPOSED*}";
     return Format( "Font {{{}}", handle );
+//
+//    LOGFONT logFont;
+//    OS.GetObject(handle, LOGFONT.sizeof, &logFont);
+//    char[] name = .TCHARzToStr( logFont.lfFaceName.ptr, -1 );
+//
+//    return Format( "Font {{{}, {}}", handle, name );
 }
 
 /**
@@ -265,6 +270,7 @@
  */
 public static Font win32_new(Device device, HFONT handle) {
     Font font = new Font(device);
+    font.disposeChecking = false;
     font.handle = handle;
     return font;
 }