summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-06-14 22:35:59 +0200
committerCarl Hetherington <cth@carlh.net>2025-06-14 22:35:59 +0200
commitff0a329bf4e4527dcdda1b7fab9a592a2c8dbce5 (patch)
tree3aacc3b3c81875b8aa2953bdedd9e20856a4de88
parent048cfa793bd8f83d44c5a120e551970eb3373404 (diff)
Catch possible exceptions in destructor.
There was a report of the player crashing with std::terminate coming from ~DOMFrame().
-rw-r--r--src/tools/dcpomatic_player.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc
index 43c071556..c0f3e29f5 100644
--- a/src/tools/dcpomatic_player.cc
+++ b/src/tools/dcpomatic_player.cc
@@ -323,11 +323,17 @@ public:
~DOMFrame ()
{
- stop_http_server();
- /* It's important that this is stopped before our frame starts destroying its children,
- * otherwise UI elements that it depends on will disappear from under it.
- */
- _viewer.stop();
+ try {
+ stop_http_server();
+ /* It's important that this is stopped before our frame starts destroying its children,
+ * otherwise UI elements that it depends on will disappear from under it.
+ */
+ _viewer.stop();
+ } catch (std::exception& e) {
+ LOG_ERROR("Destructor threw %1", e.what());
+ } catch (...) {
+ LOG_ERROR_NC("Destructor threw");
+ }
}
void close(wxCloseEvent& ev)