Fixed segfault-on-exit in octave 3.2.4
- see SourceForge #3516652 git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12994 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
117cb9b74a
commit
70e0cf60f7
1 changed files with 3 additions and 1 deletions
|
|
@ -171,7 +171,9 @@ DEFUN_DLD (SWIG_name,args,nargout,SWIG_name_d) {
|
||||||
// exiting without explicitly clearing the variable causes octave to segfault.
|
// exiting without explicitly clearing the variable causes octave to segfault.
|
||||||
#if OCTAVE_API_VERSION_NUMBER>=37
|
#if OCTAVE_API_VERSION_NUMBER>=37
|
||||||
octave_value_list SWIG_atexit_func(const octave_value_list &args, int nargout) {
|
octave_value_list SWIG_atexit_func(const octave_value_list &args, int nargout) {
|
||||||
symbol_table::clear_global_pattern("*");
|
string_vector vars = symbol_table::global_variable_names();
|
||||||
|
for (int i = 0; i < vars.length(); i++)
|
||||||
|
symbol_table::clear_global(vars[i]);
|
||||||
symbol_table::clear_functions();
|
symbol_table::clear_functions();
|
||||||
return octave_value();
|
return octave_value();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue