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: Mon, 06 Jul 2015 07:45:25 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15

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

You've characterized things pretty well now, thanks.  I think if we can just
figure out how to cleanly kill the thread so that Windows doesn't complain,
then we are close.  The other issue with qt-settings could maybe be separate. 
The time to wait seems like a question.  Maybe rather than wait 2 seconds, it
could be changed to 4 or 5 seconds.  Here's the code hunk that was applied and
should exist in the file main_window.cc:


+void
+main_window::force_exit_app (bool closenow)
+{
+  if (! closenow)
+    return;
+
+  // If confirmed, do not allow shutdown sequence again.  Doing
+  // so would mean something is wrong with the core's exit
+  // method and could lead to indefinite loop.
+  _closing = true;
+
+  // First interrupt will stop a process, so attempt exit.
+  _octave_qt_link->terminal_interrupt ();
+  octave_cmd_exec *cmd = new octave_cmd_exec ("exit");
+  queue_command (cmd);
+  _exit_in_queue = true;
+
+  // Give the core/worker two seconds to wrap up.
+  QTimer *timer = new QTimer ();
+  connect (timer, SIGNAL (timeout ()), this, SLOT (terminate_and_exit ()));
+  timer->setSingleShot (true);
+  timer->start (2000);
+}


Notice at the very end of the routine is 2000, the number of milliseconds.  If
you want to experiment, you could change that to 10000 seconds and see how
prevalent the popup warning is.

I too thought I had seen the corrupted qt-settings file upon testing.  But I
didn't think anything of it because I was in the middle of debugging.  The
only way I can think of that happening is if a qSettings object is writing the
settings at the instant a process is ended.  But that should live in the GUI
space, which supposedly is not the thread being killed.  Anyway, this one I
can probably think through and figure out what the issue is.

    _______________________________________________________

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]