gtk2: fixed mem leak

git-svn-id: trunk@42388 -
This commit is contained in:
mattias 2013-08-11 17:45:35 +00:00
parent f4aba6fdf1
commit 2dcaeb39e0

View File

@ -1357,6 +1357,7 @@ var
AttrListTemporary: Boolean;
Attr: PPangoAttribute;
CurFont: PPangoLayout;
TmpStr: PChar;
begin
{$IFDEF VerboseFonts}
DebugLn('TGtk2WidgetSet.CreateFontIndirectEx A Name=',LogFont.lfFaceName,' Height=',dbgs(LogFont.lfHeight),' LongName=',LongFontName);
@ -1467,7 +1468,9 @@ begin
if (pango_font_description_get_style (PangoDesc) = PANGO_STYLE_NORMAL)
and (lfItalic <> 0) then
pango_font_description_set_style(PangoDesc, PANGO_STYLE_ITALIC);
aStyle := pango_font_description_to_string(PangoDesc);
TmpStr := pango_font_description_to_string(PangoDesc);
aStyle := TmpStr;
g_free(TmpStr);
if (aSize=0) and (lfHeight<>0) then
begin
// a size is not specified, try to calculate one based on lfHeight