Bug 361920 - "Save File" Dialog Box not appearing upon closing program with multiple views of the same file open
Summary: "Save File" Dialog Box not appearing upon closing program with multiple views...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (other bugs)
Version First Reported In: 3.0 Alpha
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL: http://stormingtheivory.tumblr.com/po...
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-18 03:27 UTC by Sam Keeper
Modified: 2019-09-05 08:16 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Keeper 2016-04-18 03:27:56 UTC
Closing Krita while multiple views of the same file have been opened using the "new view" option fails to cause the "The document [filename] has been modified. Do you wish to save it?" dialog box to appear. This makes it erroneously seem as though the files have been saved correctly even when they haven't been.

Test cases:

The dialog box will appear under all of the following conditions:

1. Having a single copy of the file open
2. Having two completely different files open
3. Opening a second view, closing that view, then closing the program

The dialog box will not appear:

1. Having two views open of one modified file and then closing the program.
2. Opening TWO OR MORE files, and opening a second view for EVERY ONE of these files

Things go straight to crazytown if:

1. You have multiple files open, all of which have been modified, n-1 of which have multiple views open.

Several things happen in this last case that I'm having a bit of trouble parsing out. As seen in the documentation link, the amount of memory taken up by Krita undergoes a pretty big spike when you do this. If you have at least one image open WITHOUT multiple views open, the dialog will appear for JUST THAT IMAGE. As noted above, if ALL the files have a second view open, the program will simply close without the dialog. The extra weird element here is that regardless of what option is selected, once you click the exit program button, any projects with multiple views open are doomed: they will ALL close, even if you select "cancel," as seen in the last documentation image.

I think that's what's going on here, at least. It seems like anything with multiple views open just can't handle the program being closed.

System information:
Windows 8.1
Intel CPU

Reproducible: Always




I have noted this as a crash since, in essence, it functions like this from the perspective of the end user, with a similar risk of lost data, as I found out to my deep sorrow.
Comment 1 David REVOY 2016-04-18 08:59:40 UTC
I tested the bug Sam, and I can reproduce it here on last 3.0git, compiled on Ubuntu16.04.

To reproduce:
===========
* (menu) File > New  then Create a new document
* Add a random stroke on the canvas
* Try to close Krita  ==> You'll be prompted with the 'do you want to Save it?' dialog. Cancel
* (menu) Windows > New View > Unnamed
* Add a random stroke
* Try to close Krita now  ==>  Not prompted at all, all close.
Comment 2 David REVOY 2016-05-05 15:11:28 UTC
Reproduced in Krita 2.9.7 too. This bug is not a 3.0 regression.
Comment 3 Dmitry Kazakov 2016-05-06 10:15:02 UTC
Git commit 87a3ba121f23f564ab8147371ae93d9eda05efda by Dmitry Kazakov.
Committed on 06/05/2016 at 10:15.
Pushed by dkazakov into branch 'master'.

Fix saving when multiple view of the same document are open

Basically it happens because the subwindows are removed via deleteLater(),
so at first all the windows get closeEvent() and only after that the start
destructing itself and, therefore, unregistering themselves from KisPart.

Now KisPart just checks if the view is still visible to be counted in the
list of views associated with the document.
Fixes T2432

M  +1    -1    libs/ui/KisPart.cpp

http://commits.kde.org/krita/87a3ba121f23f564ab8147371ae93d9eda05efda