Mercurial > octave
diff src/octave.cc @ 9377:610bf90fce2a
update unwind_protect usage everywhere
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 23 Jun 2009 08:22:13 +0200 |
parents | 98c6b3aa0b7b |
children | d57f0c56195f |
line wrap: on
line diff
--- a/src/octave.cc Tue Jun 23 07:55:44 2009 +0200 +++ b/src/octave.cc Tue Jun 23 08:22:13 2009 +0200 @@ -291,9 +291,9 @@ static void execute_startup_files (void) { - unwind_protect::begin_frame ("execute_startup_files"); + unwind_protect::frame_id_t uwp_frame = unwind_protect::begin_frame (); - unwind_protect_bool (input_from_startup_file); + unwind_protect::protect_var (input_from_startup_file); input_from_startup_file = true; @@ -368,13 +368,13 @@ } } - unwind_protect::run_frame ("execute_startup_files"); + unwind_protect::run_frame (uwp_frame); } static int execute_eval_option_code (const std::string& code) { - unwind_protect::begin_frame ("execute_eval_option_code"); + unwind_protect::frame_id_t uwp_frame = unwind_protect::begin_frame (); octave_save_signal_mask (); @@ -388,7 +388,7 @@ octave_initialized = true; - unwind_protect_bool (interactive); + unwind_protect::protect_var (interactive); interactive = false; @@ -400,7 +400,7 @@ } catch (octave_quit_exception e) { - unwind_protect::run_frame ("execute_eval_option_code"); + unwind_protect::run_frame (uwp_frame); clean_up_and_exit (e.status); } catch (octave_interrupt_exception) @@ -414,7 +414,7 @@ << std::endl; } - unwind_protect::run_frame ("execute_eval_option_code"); + unwind_protect::run_frame (uwp_frame); return parse_status; } @@ -422,7 +422,7 @@ static void execute_command_line_file (const std::string& fname) { - unwind_protect::begin_frame ("execute_command_line_file"); + unwind_protect::frame_id_t uwp_frame = unwind_protect::begin_frame (); octave_save_signal_mask (); @@ -436,15 +436,15 @@ octave_initialized = true; - unwind_protect_bool (interactive); - unwind_protect_bool (reading_script_file); - unwind_protect_bool (input_from_command_line_file); + unwind_protect::protect_var (interactive); + unwind_protect::protect_var (reading_script_file); + unwind_protect::protect_var (input_from_command_line_file); - unwind_protect_str (curr_fcn_file_name); - unwind_protect_str (curr_fcn_file_full_name); + unwind_protect::protect_var (curr_fcn_file_name); + unwind_protect::protect_var (curr_fcn_file_full_name); - unwind_protect_str (octave_program_invocation_name); - unwind_protect_str (octave_program_name); + unwind_protect::protect_var (octave_program_invocation_name); + unwind_protect::protect_var (octave_program_name); interactive = false; reading_script_file = true; @@ -472,7 +472,7 @@ } catch (octave_quit_exception e) { - unwind_protect::run_frame ("execute_command_line_file"); + unwind_protect::run_frame (uwp_frame); clean_up_and_exit (e.status); } catch (octave_interrupt_exception) @@ -486,7 +486,7 @@ << fname << " failed" << std::endl; } - unwind_protect::run_frame ("execute_command_line_file"); + unwind_protect::run_frame (uwp_frame); } // Usage message with extra help.