diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-04-18 21:04:27 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-04-18 21:04:27 +0200 |
| commit | 17ede6c5aa05fdcad418d918e6f4ada66163a94e (patch) | |
| tree | 64bcf058df6c3c937f59912355317a2e3fae3c19 | |
| parent | 6a2d9674cee32820b8f4b98e455b65d0072eef81 (diff) | |
Fix crash if saving files during save/cancel/close (#2517).
| -rw-r--r-- | src/tools/dcpomatic.cc | 12 |
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; } |
