mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 20:30:41 +02:00
gtk: apply patch of Burkhard Carstens to fix possible memory leaks of XGetWindowProperty calls (issue #0014659)
git-svn-id: trunk@21833 -
This commit is contained in:
parent
5385b97a2e
commit
495f9f3481
@ -48,10 +48,9 @@ begin
|
|||||||
@bytes_after, gpointer(@current_desktop));
|
@bytes_after, gpointer(@current_desktop));
|
||||||
|
|
||||||
if (atomtype = XA_CARDINAL) and (format = 32) and (nitems > 0) then
|
if (atomtype = XA_CARDINAL) and (format = 32) and (nitems > 0) then
|
||||||
begin
|
|
||||||
Result := current_desktop[0];
|
Result := current_desktop[0];
|
||||||
|
if current_desktop <> nil then
|
||||||
XFree (current_desktop);
|
XFree (current_desktop);
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -75,10 +74,9 @@ begin
|
|||||||
@bytes_after, gpointer(@current_desktop));
|
@bytes_after, gpointer(@current_desktop));
|
||||||
|
|
||||||
if (atomtype = XA_CARDINAL) and (format = 32) and (nitems > 0) then
|
if (atomtype = XA_CARDINAL) and (format = 32) and (nitems > 0) then
|
||||||
begin
|
|
||||||
Result := current_desktop[0];
|
Result := current_desktop[0];
|
||||||
|
if current_desktop <> nil then
|
||||||
XFree (current_desktop);
|
XFree (current_desktop);
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GDK_WINDOW_SET_DESKTOP(Window: PGdkWindowPrivate; Desktop: gint): gint;
|
function GDK_WINDOW_SET_DESKTOP(Window: PGdkWindowPrivate; Desktop: gint): gint;
|
||||||
@ -217,8 +215,9 @@ begin
|
|||||||
Exit(True);
|
Exit(True);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
XFree(state_array);
|
|
||||||
end;
|
end;
|
||||||
|
if state_array <> nil then
|
||||||
|
XFree(state_array);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure GDK_WINDOW_MINIMIZE(Window: PGdkWindowPrivate);
|
procedure GDK_WINDOW_MINIMIZE(Window: PGdkWindowPrivate);
|
||||||
@ -278,8 +277,9 @@ begin
|
|||||||
|
|
||||||
if Result then Break;
|
if Result then Break;
|
||||||
end;
|
end;
|
||||||
XFree(state_array);
|
|
||||||
end;
|
end;
|
||||||
|
if state_array <> nil then
|
||||||
|
XFree(state_array);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure GDK_WINDOW_SHOW_IN_TASKBAR(Window: PGdkWindowPrivate; Show: Boolean);
|
procedure GDK_WINDOW_SHOW_IN_TASKBAR(Window: PGdkWindowPrivate; Show: Boolean);
|
||||||
|
@ -9802,8 +9802,9 @@ begin
|
|||||||
ay:=current_desktop[1];
|
ay:=current_desktop[1];
|
||||||
awidth:=current_desktop[2];
|
awidth:=current_desktop[2];
|
||||||
aheight:=current_desktop[3];
|
aheight:=current_desktop[3];
|
||||||
XFree (current_desktop);
|
|
||||||
end;
|
end;
|
||||||
|
if current_desktop <> nil then
|
||||||
|
XFree (current_desktop);
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user