diff libinterp/parse-tree/lex.h @ 16115:4f6c37cfbdce

cleanup lexical_feedback objects * lex.h (lexical_feedback::cleanup): New static member function. * oct-parse.yy (eval_string, parse_fcn_file): Put new clenup function on unwind-protect stack to delete lexer object. * input.cc (get_debug_input): Likewise. * toplev.cc (main_loop): Likewise.
author John W. Eaton <jwe@octave.org>
date Tue, 26 Feb 2013 10:58:33 -0500
parents 7c5e5e97a3bc
children f8e463523229
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.h
+++ b/libinterp/parse-tree/lex.h
@@ -377,6 +377,9 @@
   // information.
   std::stack <token*> token_stack;
 
+  // For unwind protect.
+  static void cleanup (lexical_feedback *lexer) { delete lexer; }
+
 private:
 
   // No copying!