octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #44485] GUI: File | Exit from main menu doesn'


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #44485] GUI: File | Exit from main menu doesn't work when Octave is busy
Date: Wed, 08 Jul 2015 21:08:01 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15

Follow-up Comment #44, bug #44485 (project octave):

I really couldn't find much on how to suppress Windows from creating a message
dialog.  I gather the message said something about improperly terminating
unexpectedly.  In any case, I think once we get to the point of terminating
the interpreter (which is unadvised except for the last resort, what we are
using it for) that all bets are off on how the program and system will work. 
The Qt discussion lists mention how terminating can freeze up resource
unexpected such as mutexes and so on.  The proper terminate/abort approach is
discussed here:

https://forum.qt.io/topic/20539/what-is-the-correct-way-to-stop-qthread

but it would require a small change to the worker thread which I don't want to
make for this solution nor ask any of the more maintainer oriented
contributors to make.  The ability to interrupt is close enough I suppose.

So I've attached an updated changeset that I think and hope is a solution that
will do and not produce messages or corrupted settings files.

1) I changed the final 2 second timeout for cleanup to 5 seconds.  Rarely will
cleanup take five seconds, I'm hoping, so the last ditch terminate should be
less likely now.

2) I changed the exit under the terminate condition from


  exit_app (6);


to 


  exit_app (0);


That may not make a difference, but maybe that will prevent some type of
Windows or Linux dialog popup window.

3) And the last one is to remove what may have been the source of problems in
the 


  // Three interrupts might cause interpreter to exit.
  _octave_qt_link->terminal_interrupt ();
  _octave_qt_link->terminal_interrupt ();
  _octave_qt_link->terminal_interrupt ();


I'm thinking now that was probably the wrong thing to do.  If this code hunk
is reached because of the cleanup timeout, it is causing an abort and that may
be what brings about the Windows message.  It might be the source of the
source of the corrupted settings file too because right after this code hunk
it might be like a race condition where the GUI code continues on and does
some QSettings sorts of things while the worker does and abort.  Not sure, but
unpredicable situation.

So give the attached changeset a try.  Thanks.

(file #34396)
    _______________________________________________________

Additional Item Attachment:

File name: octave-exit_timer-djs2015jul08.patch Size:29 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?44485>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]