Commit ec7a5c0c authored by Michael W. Vogel's avatar Michael W. Vogel
Browse files

LCL: GTK2: Fixed memory leak in StatusBar. Issue #34951

git-svn-id: trunk@60250 -
parent d66f084d
......@@ -6263,6 +6263,7 @@ var
NewShadowType: TGtkShadowType;
NewJustification: TGtkJustification;
xalign, yalign: gfloat;
MessageId: guint;
begin
//DebugLn('UpdateStatusBarPanel ',DbgS(StatusBar),' Index=',dbgs(Index));
AStatusBar := StatusBar as TStatusBar;
......@@ -6293,10 +6294,11 @@ begin
'state');
//DebugLn(' PanelText="',PanelText,'"');
if PanelText <> '' then
gtk_statusbar_push(PGTKStatusBar(StatusPanelWidget), ContextID, PGChar(PanelText))
MessageId := gtk_statusbar_push(PGTKStatusBar(StatusPanelWidget), ContextID, PGChar(PanelText))
else
gtk_statusbar_push(PGTKStatusBar(StatusPanelWidget), ContextID, '');
MessageId := gtk_statusbar_push(PGTKStatusBar(StatusPanelWidget), ContextID, '');
if MessageId > 1 then
gtk_statusbar_remove(PGTKStatusBar(StatusPanelWidget), ContextID, MessageId - 1);
if CurPanel <> nil then
begin
......@@ -6339,8 +6341,9 @@ begin
g_object_set_data(PGObject(StatusPanelWidget),'lcl_statusbar_id',
@AStatusBar.Panels[Index].ID);
g_signal_connect_after(StatusPanelWidget, 'expose-event',
TGtkSignalFunc(@gtk2PaintStatusBarWidget), AStatusBar);
if AStatusBar.Panels[Index].Style = psOwnerDraw then
g_signal_connect_after(StatusPanelWidget, 'expose-event',
TGtkSignalFunc(@gtk2PaintStatusBarWidget), AStatusBar);
end;
end;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment