gtk2 intf: fixed mem leak

git-svn-id: trunk@9265 -
This commit is contained in:
mattias 2006-05-13 08:52:21 +00:00
parent 6549ac35a0
commit 6746f6ade9
3 changed files with 14 additions and 6 deletions

View File

@ -288,11 +288,7 @@ end;
function TGTKWidgetSet.FontCanUTF8(Font: HFont): boolean;
begin
Result:=IsValidGDIObject(Font) and
{$IFDEF GTK2}
FontIsDoubleByteCharsFont(gdk_font_from_description(PGdiObject(Font)^.GDIFontObject));
{$ELSE GTK2}
FontIsDoubleByteCharsFont(PGdiObject(Font)^.GDIFontObject);
{$ENDIF GTK2}
FontIsDoubleByteCharsFont(PGdiObject(Font)^.GDIFontObject);
end;
{------------------------------------------------------------------------------

View File

@ -8097,6 +8097,17 @@ begin
Result:=(SingleCharLen=0) and (DoubleCharLen>0);
end;
{$Ifdef GTK2}
function FontIsDoubleByteCharsFont(TheFont: PPangoFontDescription): boolean;
var
Font: PGdkFont;
begin
Font:=gdk_font_from_description(TheFont);
Result:=FontIsDoubleByteCharsFont(Font);
gdk_font_unref(Font);
end;
{$ENDIF Gtk2}
{------------------------------------------------------------------------------
Method: GDKPixel2GDIRGB
Params:

View File

@ -757,12 +757,13 @@ Function StyleForegroundColor(Color: TColorRef; DefaultColor: PGDKColor): PGDKCo
procedure UpdateWidgetStyleOfControl(AWinControl: TWinControl);
// fonts
function FontIsDoubleByteCharsFont(TheFont: PGdkFont): boolean;
{$Ifdef GTK2}
function FontIsDoubleByteCharsFont(TheFont: PPangoFontDescription): boolean;
function LoadDefaultFontDesc: PPangoFontDescription;
Procedure GetTextExtentIgnoringAmpersands(FontDesc: PPangoFontDescription; Str: PChar;
LineLength: Longint; lbearing, rbearing, width, ascent, descent: Pgint);
{$ENDIF}
function FontIsDoubleByteCharsFont(TheFont: PGdkFont): boolean;
{$IFDEF GTK1}
function LoadDefaultFont: PGDKFont;
Procedure GetTextExtentIgnoringAmpersands(FontDesc: PGDKFont; Str: PChar;