changeset 29760:61eb6602189b

don't clear dock widget pointers in main window dtor (bug #60646, bug #60750) If a dock widget is docked to the main window, it will have the main window as its parent and will be deleted when the main_window object is deleted. Then, because we use QPointer for those objects, it will be set to nullptr and the base_qobject will recreate it if needed. If a dock widget is not docked, then its parent will not be main_window and it will not be deleted when the main_window destructor is executed and will remain available if Octave is returning to command line mode. * main-window.cc (main_window::~main_window): Don't clear dock widget pointers.
author John W. Eaton <jwe@octave.org>
date Tue, 15 Jun 2021 12:31:05 -0400
parents ad1491462d13
children 3b5ffc4c70e9
files libgui/src/main-window.cc
diffstat 1 files changed, 0 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/main-window.cc	Mon Jun 14 16:43:33 2021 -0400
+++ b/libgui/src/main-window.cc	Tue Jun 15 12:31:05 2021 -0400
@@ -329,28 +329,6 @@
 
     delete m_release_notes_window;
     delete m_community_news_window;
-
-    // Prevent floating dock widgets from being deleted.
-
-    if (m_history_window->isFloating ())
-      m_history_window.clear ();
-
-    if (m_file_browser_window->isFloating ())
-      m_file_browser_window.clear ();
-
-    if (m_doc_browser_window->isFloating ())
-      m_doc_browser_window.clear ();
-
-#if 0
-    if (m_editor_window->isFloating ())
-      m_editor_window.clear ();
-#endif
-
-    if (m_workspace_window->isFloating ())
-      m_workspace_window.clear ();
-
-    if (m_variable_editor_window->isFloating ())
-      m_variable_editor_window.clear ();
   }
 
   void main_window::make_dock_widget_connections (octave_dock_widget *dw)