mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-08 10:39:15 +02:00
gtk2 intf: fixed mem leak
git-svn-id: trunk@9265 -
This commit is contained in:
parent
6549ac35a0
commit
6746f6ade9
@ -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;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user