Mercurial > hg > octave-nkf
diff src/parse.h @ 13970:c93b953f7d54
plug some memory leaks
* oct-parse.yy, parse.h (cleanup_statement_list): New function.
* toplev.cc (main_loop): Put cleanup_statement_list on the
unwind_protect stack to delete the command list created by the
parser instead of deleting it directly.
* oct-parse.yy (parse_fcn_file, eval_string): Likewise.
* input.cc (get_debug_input): Likewise.
* pt-loop.cc (tree_simple_for_command::~tree_simple_for_command,
tree_complex_for_command::~tree_complex_for_command):
Also delete lhs expression.
* pt-idx.cc (tree_index_expression::~tree_index_expression):
Also delete contents of dyn_field list.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 01 Dec 2011 04:26:46 -0500 |
parents | fd0a3ac60b0e |
children | 72c96de7a403 |
line wrap: on
line diff
--- a/src/parse.h +++ b/src/parse.h @@ -36,6 +36,7 @@ class tree; class tree_matrix; class tree_identifier; +class tree_statement_list; class octave_function; #include "oct-obj.h" @@ -113,4 +114,6 @@ extern OCTINTERP_API octave_value eval_string (const std::string&, bool silent, int& parse_status); +extern OCTINTERP_API void cleanup_statement_list (tree_statement_list **lst); + #endif