Close down the FilmViewer before its GUI elements get destroyed (#1982).
authorCarl Hetherington <cth@carlh.net>
Thu, 22 Apr 2021 23:08:17 +0000 (01:08 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 22 Apr 2021 23:08:17 +0000 (01:08 +0200)
Otherwise this happens when we're already in the middle of destroying
the UI.

src/tools/dcpomatic_player.cc

index 506ba052e8a113e9dfef7dfe51b4b8f2d9f1529f..c0587ed5557efcf64ec9acf48871e7fa6f422065 100644 (file)
@@ -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());