From 34051e30d6ce922b28f178a3f24462a5ed9d0c4c Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 24 Sep 2007 10:46:05 +0000 Subject: (draw_monitor) fix crash (#33023) However, there's a race window on "gtkflush() while $isconnected == -2 || $isconnected == -1" where net_monitor can continue executing (with an empty window): Gtk-CRITICAL **: gtk_main_quit: assertion `main_loops != NULL' failed at /usr/lib/libDrakX/mygtk2.pm line 915. kid exited -1 at /usr/lib/libDrakX/run_program.pm line 167. Gtk-CRITICAL **: gtk_label_set_text: assertion `GTK_IS_LABEL (label)' failed at ./bin/net_monitor line 468. Gtk-CRITICAL **: gtk_label_set_text: assertion `GTK_IS_LABEL (label)' failed at ./bin/net_monitor line 469. --- bin/net_monitor | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bin') diff --git a/bin/net_monitor b/bin/net_monitor index b9ca3de..a93fea2 100755 --- a/bin/net_monitor +++ b/bin/net_monitor @@ -486,6 +486,9 @@ sub draw_monitor { defined $darea->{$intf} or return; my $gcl = $gc_lines->{$intf}; my $pixmap = $pixmap->{$intf}; + my $gc = $darea->{$intf}->style->white_gc; + # fix race on ugtk2->exit that causes a crash (#33023) + return 0 if !$gc; $pixmap->draw_rectangle($darea->{$intf}->style->black_gc, 1, 0, 0, $width, $height); my $maxr = 0; foreach (@{$o->{stack_r}}) { $maxr = $_ if $_ > $maxr } -- cgit v1.2.1