From cde59064499abaf8f30d0979747041af363cbef4 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 23 Apr 2021 01:08:17 +0200 Subject: [PATCH] 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. --- src/tools/dcpomatic_player.cc | 8 ++++++++ 1 file changed, 8 insertions(+) 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()); -- 2.30.2