Disable warnings around all wx includes.
[dcpomatic.git] / src / wx / standard_controls.cc
index 1e4ecc8d7fc74e5469c76759272110d209f42f1d..cef06d29cf695c1af92e8e9e1255b2fc7ac2b2f0 100644 (file)
 
 #include "film_viewer.h"
 #include "standard_controls.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/tglbtn.h>
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 
 using std::shared_ptr;
@@ -63,14 +66,15 @@ StandardControls::play_clicked ()
 void
 StandardControls::check_play_state ()
 {
-       if (!_film || _film->video_frame_rate() == 0) {
+       auto viewer = _viewer.lock ();
+       if (!_film || _film->video_frame_rate() == 0 || !viewer) {
                return;
        }
 
        if (_play_button->GetValue()) {
-               _viewer->start ();
+               viewer->start ();
        } else {
-               _viewer->stop ();
+               viewer->stop ();
        }
 }