summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-04-18 21:04:27 +0200
committerCarl Hetherington <cth@carlh.net>2023-04-18 21:04:27 +0200
commit17ede6c5aa05fdcad418d918e6f4ada66163a94e (patch)
tree64bcf058df6c3c937f59912355317a2e3fae3c19
parent6a2d9674cee32820b8f4b98e455b65d0072eef81 (diff)
Fix crash if saving files during save/cancel/close (#2517).
-rw-r--r--src/tools/dcpomatic.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index bd5be54ae..a7b3af8bc 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -1269,14 +1269,20 @@ private:
return true;
}
- if (_film->dirty ()) {
+ while (_film->dirty()) {
T dialog(_film->name());
switch (dialog.run()) {
case wxID_NO:
return true;
case wxID_YES:
- _film->write_metadata ();
- return true;
+ try {
+ _film->write_metadata();
+ return true;
+ } catch (exception& e) {
+ error_dialog(this, _("Could not save project."), std_to_wx(e.what()));
+ /* Go round again for another try */
+ }
+ break;
case wxID_CANCEL:
return false;
}