mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 09:10:20 +02:00
Gtk3: fixed mem leak with PPangoFontDescription. Patch by Anton Kavalenka. issue #41372
This commit is contained in:
parent
fc756a2d08
commit
e454516c68
@ -68,6 +68,7 @@ type
|
|||||||
FContext: HDC;
|
FContext: HDC;
|
||||||
FPaintData: TPaintData;
|
FPaintData: TPaintData;
|
||||||
FDrawSignal: GULong; // needed by designer
|
FDrawSignal: GULong; // needed by designer
|
||||||
|
FFont: PPangoFontDescription;
|
||||||
class function WidgetEvent(widget: PGtkWidget; event: PGdkEvent; data: GPointer): gboolean; cdecl; static; {main event filter of widget}
|
class function WidgetEvent(widget: PGtkWidget; event: PGdkEvent; data: GPointer): gboolean; cdecl; static; {main event filter of widget}
|
||||||
strict private
|
strict private
|
||||||
FCentralWidgetRGBA: array [0{GTK_STATE_NORMAL}..4{GTK_STATE_INSENSITIVE}] of TDefaultRGBA;
|
FCentralWidgetRGBA: array [0{GTK_STATE_NORMAL}..4{GTK_STATE_INSENSITIVE}] of TDefaultRGBA;
|
||||||
@ -2436,6 +2437,9 @@ begin
|
|||||||
if IsWidgetOk then
|
if IsWidgetOk then
|
||||||
begin
|
begin
|
||||||
GetContainerWidget^.override_font(AValue);
|
GetContainerWidget^.override_font(AValue);
|
||||||
|
if Assigned(FFont) and (FFont <> AValue) then
|
||||||
|
FFont^.free;
|
||||||
|
FFont := AValue;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user