# HG changeset patch # User Torsten # Date 1424714668 -3600 # Node ID a09471d938a51df3e97ae5a4c2ba11832c6c47fd # Parent 0178c5a98d6f8a90b9dcda9b35bb5ba2a2721c32 fix closing a tab with modification * file-editor-tab.cc (closeEvent): reset static flag _cancelled to false diff -r 0178c5a98d6f -r a09471d938a5 libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc Tue Feb 24 11:03:45 2015 +0000 +++ b/libgui/src/m-editor/file-editor-tab.cc Mon Feb 23 19:04:28 2015 +0100 @@ -184,10 +184,14 @@ void file_editor_tab::closeEvent (QCloseEvent *e) { - // ignore close event if file is not saved and user cancels - // closing this window + _cancelled = false; // prevent unwanted interaction of previous + // exits of octave which were canceled by the user + if (check_file_modified () == QMessageBox::Cancel) - e->ignore (); + { // ignore close event if file is not saved and user cancels + // closing this window + e->ignore (); + } else { e->accept ();