diff src/toplev.cc @ 9260:9c2349a51218

properly unmark forced variables
author John W. Eaton <jwe@octave.org>
date Tue, 26 May 2009 11:20:40 -0400 (2009-05-26)
parents 1c2d2c9f4a8d
children 610bf90fce2a 67ad3b58b99a
line wrap: on
line diff
--- a/src/toplev.cc
+++ b/src/toplev.cc
@@ -548,10 +548,18 @@
     {
       try
 	{
+	  unwind_protect::begin_frame ("main_loop");
+
 	  reset_error_handler ();
 
 	  reset_parser ();
 
+	  // Do this with an unwind-protect cleanup function so that
+	  // the forced variables will be unmarked in the event of an
+	  // interrupt.
+	  symbol_table::scope_id scope = symbol_table::top_scope ();
+	  unwind_protect::add (symbol_table::unmark_forced_variables, &scope);
+
 	  // This is the same as yyparse in parse.y.
 	  retval = octave_parse ();
 
@@ -602,6 +610,8 @@
 	      else if (parser_end_of_input)
 		break;
 	    }
+
+	  unwind_protect::run_frame ("main_loop");
 	}
       catch (octave_quit_exception e)
         {