From 3c3721122e0e8caef69f19508a81217830919342 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 9 Oct 2009 14:57:59 +0000 Subject: (mainwindow) prevent crashing if one click on a media checkbox while another click event is already being processed (#46727) rationale: flush() process waiting events including potential clicks on other media checkboxes, thus causing gtk+ to reenter the callback when we were processing refreshing events, which is not reentrant --- NEWS | 4 ++++ Rpmdrake/edit_urpm_sources.pm | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index d668e51a..da813afb 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +- edit-urpm-sources: + o prevent crashing if one click on a media checkbox while another + one is being processed (gtk+ was reentering the callback when we + were processing refreshing events...) (#46727) - rpmdrake o fix searching on just names (#54339) diff --git a/Rpmdrake/edit_urpm_sources.pm b/Rpmdrake/edit_urpm_sources.pm index 5fb3d3c0..d02cdeb9 100644 --- a/Rpmdrake/edit_urpm_sources.pm +++ b/Rpmdrake/edit_urpm_sources.pm @@ -1055,10 +1055,12 @@ sub mainwindow() { $list_tv->append_column(Gtk2::TreeViewColumn->new_with_attributes(N("Medium"), Gtk2::CellRendererText->new, 'text' => $col{mainw}{name})); - - $tr->signal_connect( + my $id; + $id = $tr->signal_connect( toggled => sub { my (undef, $path) = @_; + $tr->signal_handler_block($id); + my $_guard = before_leaving { $tr->signal_handler_unblock($id) }; my $iter = $list->get_iter_from_string($path); $urpm->{media}[$path]{ignore} = !$urpm->{media}[$path]{ignore} || undef; $list->set($iter, $col{mainw}{is_enabled}, !$urpm->{media}[$path]{ignore}); -- cgit v1.2.1