I got this same problem sometimes.
Im suggest you to use “Auto save”, configure time of Auto save, so even if you click discard you can always load copy of your work.
I don’t really think we need an additional dialog for saving and discarding, the one that pops up is already a double-check. Get into a habit of pressing CTRL+S before attempting to close the file and you’ll never have a problem again.
Please use the format for feature requests the next time you make a thread in this category, it is compulsory!