mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 08:19:29 +02:00
Gtk2: fixed few memleaks with PGList in TGtk2ListView.
git-svn-id: trunk@38899 -
This commit is contained in:
parent
eff9f1abee
commit
1f6e44d04f
@ -270,6 +270,7 @@ begin
|
|||||||
Widgets^.ItemCache.Objects[ListIndex] := TObject(0);
|
Widgets^.ItemCache.Objects[ListIndex] := TObject(0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
g_list_free(List);
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
// complete selection is clear !
|
// complete selection is clear !
|
||||||
@ -329,6 +330,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
Path := PGtkTreePath(g_list_first(List)^.data);
|
Path := PGtkTreePath(g_list_first(List)^.data);
|
||||||
Widgets^.ItemCache.Add(gtk_tree_path_to_string(Path));
|
Widgets^.ItemCache.Add(gtk_tree_path_to_string(Path));
|
||||||
|
g_list_free(List);
|
||||||
end else
|
end else
|
||||||
exit;
|
exit;
|
||||||
end else
|
end else
|
||||||
@ -1901,8 +1903,11 @@ begin
|
|||||||
AList := gtk_icon_view_get_selected_items(PGtkIconView(MainView))
|
AList := gtk_icon_view_get_selected_items(PGtkIconView(MainView))
|
||||||
else
|
else
|
||||||
Exit;
|
Exit;
|
||||||
Result := g_list_length(AList);
|
if AList <> nil then
|
||||||
g_list_free(AList);
|
begin
|
||||||
|
Result := g_list_length(AList);
|
||||||
|
g_list_free(AList);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1929,8 +1934,10 @@ begin
|
|||||||
begin
|
begin
|
||||||
AList := gtk_icon_view_get_selected_items(PGtkIconView(MainView));
|
AList := gtk_icon_view_get_selected_items(PGtkIconView(MainView));
|
||||||
if AList <> nil then
|
if AList <> nil then
|
||||||
Path := g_list_first(AList)^.data
|
begin
|
||||||
else
|
Path := g_list_first(AList)^.data;
|
||||||
|
g_list_free(AList);
|
||||||
|
end else
|
||||||
Path := nil;
|
Path := nil;
|
||||||
end;
|
end;
|
||||||
Path := gtk_tree_model_get_path(TreeModel, @Iter);
|
Path := gtk_tree_model_get_path(TreeModel, @Iter);
|
||||||
|
Loading…
Reference in New Issue
Block a user