Fixed some gtk2 memory leaks where GtkTreePath's were not freed

git-svn-id: trunk@12565 -
This commit is contained in:
andrew 2007-10-23 14:47:19 +00:00
parent 4a43243f86
commit 5ba8252275
2 changed files with 8 additions and 2 deletions

View File

@ -116,7 +116,10 @@ begin
or gtk_tree_view_get_path_at_pos(PGtkTreeView(Widget),cell_area^.x+cell_area^.width, cell_area^.y, ItemPath, column, nil, nil)
or gtk_tree_view_get_path_at_pos(PGtkTreeView(Widget),cell_area^.x+cell_area^.width, cell_area^.y+cell_area^.height, ItemPath, column, nil, nil)
then
begin
ItemIndex := StrToInt(gtk_tree_path_to_string(ItemPath));
gtk_tree_path_free(ItemPath);
end;
end
else if AWinControl is TCustomComboBox then begin
// ComboItem is set in gtk2wsstdctrls

View File

@ -1052,8 +1052,11 @@ begin
with Widgets^ do begin
gtk_tree_view_get_cursor(PGtkTreeView(MainView), Path, Column);
if Path <> nil
then Result := StrToInt(PChar(Path));
if Path <> nil then
begin
Result := StrToInt(PChar(Path));
gtk_tree_path_free(Path);
end;
end;
end;