From 0d8f7d04925d7f383c7beb7785da2cf5deae2932 Mon Sep 17 00:00:00 2001 From: Bart Hakvoort Date: Sun, 6 Feb 2005 22:11:32 +0000 Subject: [PATCH] fixed a potential infinite loop in Show_Pulsebar() (thanks to xilun) * src/Win_GParted.cc: fixed a potential infinite loop in Show_Pulsebar() (thanks to xilun) --- ChangeLog | 4 ++++ src/Win_GParted.cc | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1e3a13e8..fb5d2110 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-02-06 Bart Hakvoort + + * src/Win_GParted.cc: fixed a potential infinite loop in Show_Pulsebar() (thanks to xilun) + 2005-02-01 Bart Hakvoort * Fixed a bunch of bugs (some of them crashers) which showed up if no devices were detected. diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index d13f78be..43f958df 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -376,7 +376,6 @@ void Win_GParted::Show_Pulsebar( ) menu_partition .set_sensitive( false ) ; //the actual 'pulsing' - pulse = true ; while ( pulse ) { pulsebar ->pulse( ); @@ -482,7 +481,7 @@ void Win_GParted::Refresh_Visual( ) //set new statusbartext statusbar .pop( ) ; if ( operations .size( ) != 1 ) - statusbar .push( String::ucompose( _("%1 operations pending"), operations .size( ) ) .c_str( ) ); + statusbar .push( String::ucompose( _("%1 operations pending"), operations .size( ) ) ); else statusbar .push( _( "1 operation pending" ) ); @@ -688,6 +687,7 @@ void Win_GParted::optionmenu_devices_changed( ) void Win_GParted::menu_gparted_refresh_devices( ) { //find out if there was any change in available devices (think about flexible media like zipdisks/usbsticks/whatever ;-) ) + pulse = true ;//set to true before creating the thread to prevent _possible_ infinite loop in Show_Pulsebar( ) thread = Glib::Thread::create( SigC::slot_class( *this, &Win_GParted::find_devices_thread ), true ); Show_Pulsebar( ) ;