summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/ugtk3.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/perl-install/ugtk3.pm b/perl-install/ugtk3.pm
index 9499e8c56..20e19bac7 100644
--- a/perl-install/ugtk3.pm
+++ b/perl-install/ugtk3.pm
@@ -241,8 +241,9 @@ sub gtktreeview_children {
my ($model, $iter) = @_;
my @l;
$model or return;
- for (my $p = $model->iter_children($iter); $p; $p = $model->iter_next($p)) {
- push @l, $p;
+ my $p = $model->iter_children($iter);
+ while ($model->iter_next($p)) {
+ push @l, $p->copy;
}
@l;
}
@@ -1273,7 +1274,8 @@ sub get_path_str {
sub iter_each_children {
my ($model, $iter, $f) = @_;
- for (my $child = $model->iter_children($iter); $child; $child = $model->iter_next($child)) {
+ my $child = $model->iter_children($iter);
+ while ($child = $model->iter_next($child)) {
$f->($child);
}
}