# HG changeset patch # User jwe # Date 759738809 0 # Node ID 1412ea9fc8280fa23c249e2189d042a83697b2b5 # Parent 712cc23447fcc0d12d65cab899ff5724d0c9d447 [project @ 1994-01-28 06:33:29 by jwe] diff --git a/src/octave.cc b/src/octave.cc --- a/src/octave.cc +++ b/src/octave.cc @@ -63,7 +63,7 @@ #include "file-io.h" #include "sysdep.h" -#ifdef sun +#if !defined (HAVE_ATEXIT) && defined (HAVE_ON_EXIT) extern "C" { int on_exit (); } #define atexit on_exit #endif @@ -354,6 +354,8 @@ close_files (); + cleanup_tmp_files (); + if (!quitting_gracefully && (interactive || forced_interactive)) cout << "\n"; @@ -436,8 +438,12 @@ } } -// Make sure we clean up when we exit. +#if defined (HAVE_ATEXIT) || (HAVE_ON_EXIT) +// Make sure we clean up when we exit. If we don't have atexit or +// on_exit, we're going to leave some junk files around if we exit +// abnormally. atexit (cleanup_tmp_files); +#endif initialize_history ();