Mercurial > hg > octave-shane
changeset 9991:1300d9ced492
F__init_fltk__: add __remove_fltk__ to atexit function list
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 16 Dec 2009 01:25:40 -0500 |
parents | 2b008f1d3794 |
children | a5a05b2ebb9d |
files | src/ChangeLog src/DLD-FUNCTIONS/fltk_backend.cc |
diffstat | 2 files changed, 17 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2009-12-16 John W. Eaton <jwe@octave.org> + + * DLD-FUNCTIONS/fltk_backend.cc (F__init_fltk__): + Add __remove_fltk__ to the list of atexit functions. + (F__remove_fltk__): Wait fltk_maxtime instead of 10 seconds. + 2009-12-15 John W. Eaton <jwe@octave.org> * toplev.cc (do_goto_frame_relative): Stop searching at top
--- a/src/DLD-FUNCTIONS/fltk_backend.cc +++ b/src/DLD-FUNCTIONS/fltk_backend.cc @@ -63,6 +63,7 @@ #include "gl2ps-renderer.h" #include "graphics.h" #include "parse.h" +#include "toplev.h" #include "variables.h" #define FLTK_BACKEND_NAME "fltk" @@ -1005,6 +1006,8 @@ DEFUN_DLD (__init_fltk__, , , "") { + static bool remove_fltk_registered = false; + if (! backend_registered) { mlock (); @@ -1015,6 +1018,13 @@ octave_value_list args; args(0) = "__fltk_redraw__"; feval ("add_input_event_hook", args, 0); + + if (! remove_fltk_registered) + { + octave_add_atexit_function ("__remove_fltk__"); + + remove_fltk_registered = true; + } } octave_value retval; @@ -1039,8 +1049,7 @@ feval ("remove_input_event_hook", args, 0); // FIXME ??? - // give FLTK 10 seconds to wrap it up - Fl::wait(10); + Fl::wait (fltk_maxtime); } octave_value retval;