summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-04-23 01:08:17 +0200
committerCarl Hetherington <cth@carlh.net>2021-04-23 01:08:17 +0200
commitcde59064499abaf8f30d0979747041af363cbef4 (patch)
tree15c091a2eba4f91a821e3053568fdcc0e18639cc
parentfbf3c5e1ade71c1b444b38d6c0e30d879004b527 (diff)
Close down the FilmViewer before its GUI elements get destroyed (#1982).
Otherwise this happens when we're already in the middle of destroying the UI.
-rw-r--r--src/tools/dcpomatic_player.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc
index 506ba052e..c0587ed55 100644
--- a/src/tools/dcpomatic_player.cc
+++ b/src/tools/dcpomatic_player.cc
@@ -259,6 +259,14 @@ public:
_stress.LoadDCP.connect (boost::bind(&DOMFrame::load_dcp, this, _1));
}
+ ~DOMFrame ()
+ {
+ /* 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.reset ();
+ }
+
void setup_main_sizer (Config::PlayerMode mode)
{
_main_sizer->Detach (_viewer->panel());