summaryrefslogtreecommitdiff
path: root/src/wx/standard_controls.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-09-12 01:09:03 +0200
committerCarl Hetherington <cth@carlh.net>2021-09-27 13:41:46 +0200
commit0b791ea708dfa1f5cd44522988dd5efdf2a0b94b (patch)
tree39cb17f7a05b6ef468a6947cee7910a098aa020c /src/wx/standard_controls.cc
parent10f36696805235c774890a4618b7187dd75750d4 (diff)
Tidy ownership/lifetime of GLVideoView to fix crashes on close.
Diffstat (limited to 'src/wx/standard_controls.cc')
-rw-r--r--src/wx/standard_controls.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/wx/standard_controls.cc b/src/wx/standard_controls.cc
index 1e4ecc8d7..6196c1b5c 100644
--- a/src/wx/standard_controls.cc
+++ b/src/wx/standard_controls.cc
@@ -63,14 +63,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 ();
}
}