changeset 27041:43f6f02dd91c

fix missing unlock of mutex when gui editor is not present (bug #56097) * main-window.cc (file_remove_proxy): call editor methods only if editor is available; (construct): connect file_remove_signal of octave_qt_link with the related slot in main_window with the required unlock also if editor is not present
author Torsten Lilge <ttl-octave@mailbox.org>
date Wed, 10 Apr 2019 23:53:01 +0200
parents 8408acb7ca4f
children 2faa56886789
files libgui/src/main-window.cc
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/main-window.cc	Mon Apr 08 00:36:33 2019 +0000
+++ b/libgui/src/main-window.cc	Wed Apr 10 23:53:01 2019 +0200
@@ -495,7 +495,9 @@
     m_octave_qt_link->lock ();
 
     // Close the file if opened
+#if defined (HAVE_QSCINTILLA)
     m_editor_window->handle_file_remove (o, n);
+#endif
 
     // We are done: Unlock and wake the worker thread
     m_octave_qt_link->unlock ();
@@ -1868,12 +1870,14 @@
              m_editor_window, SLOT (handle_file_renamed (bool)));
 
     // Signals for removing/renaming files/dirs in the temrinal window
+    connect (m_octave_qt_link, SIGNAL (file_renamed_signal (bool)),
+             m_editor_window, SLOT (handle_file_renamed (bool)));
+#endif
+
+    // Signals for removing/renaming files/dirs in the temrinal window
     connect (m_octave_qt_link,
              SIGNAL (file_remove_signal (const QString&, const QString&)),
              this, SLOT (file_remove_proxy (const QString&, const QString&)));
-    connect (m_octave_qt_link, SIGNAL (file_renamed_signal (bool)),
-             m_editor_window, SLOT (handle_file_renamed (bool)));
-#endif
 
     octave_link::post_event (this,
                              &main_window::resize_command_window_callback);