diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-03-17 18:05:52 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-03-17 18:05:52 +0000 |
commit | cb82cae6ae6aab39d025937d6fd02b3bddd5f185 (patch) | |
tree | eda53ef04cd1fabbac90a5beea729570f271df33 /perl-install | |
parent | 33c8603284d03db56ffdf2b7136bb318beff8744 (diff) | |
download | drakx-cb82cae6ae6aab39d025937d6fd02b3bddd5f185.tar drakx-cb82cae6ae6aab39d025937d6fd02b3bddd5f185.tar.gz drakx-cb82cae6ae6aab39d025937d6fd02b3bddd5f185.tar.bz2 drakx-cb82cae6ae6aab39d025937d6fd02b3bddd5f185.tar.xz drakx-cb82cae6ae6aab39d025937d6fd02b3bddd5f185.zip |
ensure the val registrations are kept ordered
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/mygtk2.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm index 7208c30e9..3dc27b7fa 100644 --- a/perl-install/mygtk2.pm +++ b/perl-install/mygtk2.pm @@ -76,10 +76,10 @@ sub gtkval_register { my ($w, $ref, $sub) = @_; push @{$w->{_ref}}, $ref; $w->signal_connect(destroy => sub { - delete $refs{$ref}{$w}; - delete $refs{$ref} if !%{$refs{$ref}}; + @{$refs{$ref}} = grep { $_->[1] != $w } @{$refs{$ref}}; + delete $refs{$ref} if !@{$refs{$ref}}; }); - push @{$refs{$ref}{$w}}, [ $sub, $w ]; + push @{$refs{$ref}}, [ $sub, $w ]; } sub gtkval_modify { my ($ref, $val, @to_skip) = @_; @@ -88,7 +88,7 @@ sub gtkval_modify { if ($prev ne '' . $ref) { internal_error(); } - foreach (map { @$_ } values %{$refs{$ref} || {}}) { + foreach (@{$refs{$ref} || []}) { my ($f, @para) = @$_; $f->(@para) if !member($f, @to_skip); } |