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:
paul 2009-09-23 10:27:34 +00:00
parent 5385b97a2e
commit 495f9f3481
2 changed files with 8 additions and 7 deletions

View File

@ -48,10 +48,9 @@ begin
@bytes_after, gpointer(@current_desktop));
if (atomtype = XA_CARDINAL) and (format = 32) and (nitems > 0) then
begin
Result := current_desktop[0];
if current_desktop <> nil then
XFree (current_desktop);
end;
end;
@ -75,10 +74,9 @@ begin
@bytes_after, gpointer(@current_desktop));
if (atomtype = XA_CARDINAL) and (format = 32) and (nitems > 0) then
begin
Result := current_desktop[0];
if current_desktop <> nil then
XFree (current_desktop);
end;
end;
function GDK_WINDOW_SET_DESKTOP(Window: PGdkWindowPrivate; Desktop: gint): gint;
@ -217,8 +215,9 @@ begin
Exit(True);
end;
end;
XFree(state_array);
end;
if state_array <> nil then
XFree(state_array);
end;
procedure GDK_WINDOW_MINIMIZE(Window: PGdkWindowPrivate);
@ -278,8 +277,9 @@ begin
if Result then Break;
end;
XFree(state_array);
end;
if state_array <> nil then
XFree(state_array);
end;
procedure GDK_WINDOW_SHOW_IN_TASKBAR(Window: PGdkWindowPrivate; Show: Boolean);

View File

@ -9802,8 +9802,9 @@ begin
ay:=current_desktop[1];
awidth:=current_desktop[2];
aheight:=current_desktop[3];
XFree (current_desktop);
end;
if current_desktop <> nil then
XFree (current_desktop);
end;
{$ENDIF}