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

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

[Octave-bug-tracker] [bug #63548] GUI closing suddenly when selecting a


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #63548] GUI closing suddenly when selecting a recently deleted file
Date: Tue, 20 Dec 2022 15:13:45 -0500 (EST)

Follow-up Comment #19, bug #63548 (project octave):

I'd guess we are trying to open the file in read-only mode because we don't
want to create the file just yet at that point. Instead, we'd like to ask for
confirmation first whether the file should be created.

The following change also avoids the crash for me while still re-using an
existing "unnamed" tab:

diff -r 8db976e36127 libgui/src/m-editor/file-editor.cc
--- a/libgui/src/m-editor/file-editor.cc        Mon Dec 19 10:15:48 2022 -0800
+++ b/libgui/src/m-editor/file-editor.cc        Tue Dec 20 21:13:14 2022 +0100
@@ -1654,8 +1654,11 @@
               }
             else
               {
-                delete fileEditorTab;
-                fileEditorTab = nullptr;
+                if (! reusing)
+                  {
+                    delete fileEditorTab;
+                    fileEditorTab = nullptr;
+                  }
 
                 if (QFile::exists (openFileName))
                   {




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63548>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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