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)
This commit is contained in:
Bart Hakvoort 2005-02-06 22:11:32 +00:00
parent f40502b978
commit 0d8f7d0492
2 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2005-02-06 Bart Hakvoort <hakvoort@cvs.gnome.org>
* src/Win_GParted.cc: fixed a potential infinite loop in Show_Pulsebar() (thanks to xilun)
2005-02-01 Bart Hakvoort <hakvoort@cvs.gnome.org> 2005-02-01 Bart Hakvoort <hakvoort@cvs.gnome.org>
* Fixed a bunch of bugs (some of them crashers) which showed up if no devices were detected. * Fixed a bunch of bugs (some of them crashers) which showed up if no devices were detected.

View File

@ -376,7 +376,6 @@ void Win_GParted::Show_Pulsebar( )
menu_partition .set_sensitive( false ) ; menu_partition .set_sensitive( false ) ;
//the actual 'pulsing' //the actual 'pulsing'
pulse = true ;
while ( pulse ) while ( pulse )
{ {
pulsebar ->pulse( ); pulsebar ->pulse( );
@ -482,7 +481,7 @@ void Win_GParted::Refresh_Visual( )
//set new statusbartext //set new statusbartext
statusbar .pop( ) ; statusbar .pop( ) ;
if ( operations .size( ) != 1 ) 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 else
statusbar .push( _( "1 operation pending" ) ); statusbar .push( _( "1 operation pending" ) );
@ -688,6 +687,7 @@ void Win_GParted::optionmenu_devices_changed( )
void Win_GParted::menu_gparted_refresh_devices( ) 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 ;-) ) //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 ); thread = Glib::Thread::create( SigC::slot_class( *this, &Win_GParted::find_devices_thread ), true );
Show_Pulsebar( ) ; Show_Pulsebar( ) ;