diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-09-12 01:09:03 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-09-27 13:41:46 +0200 |
| commit | 0b791ea708dfa1f5cd44522988dd5efdf2a0b94b (patch) | |
| tree | 39cb17f7a05b6ef468a6947cee7910a098aa020c /src/wx/system_information_dialog.cc | |
| parent | 10f36696805235c774890a4618b7187dd75750d4 (diff) | |
Tidy ownership/lifetime of GLVideoView to fix crashes on close.
Diffstat (limited to 'src/wx/system_information_dialog.cc')
| -rw-r--r-- | src/wx/system_information_dialog.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/wx/system_information_dialog.cc b/src/wx/system_information_dialog.cc index 968cd5740..7aabf1bf5 100644 --- a/src/wx/system_information_dialog.cc +++ b/src/wx/system_information_dialog.cc @@ -38,8 +38,11 @@ using std::shared_ptr; SystemInformationDialog::SystemInformationDialog (wxWindow* parent, weak_ptr<FilmViewer> weak_viewer) : TableDialog (parent, _("System information"), 2, 1, false) { - shared_ptr<FilmViewer> viewer = weak_viewer.lock (); - GLVideoView const * gl = viewer ? dynamic_cast<GLVideoView const *>(viewer->video_view()) : 0; + auto viewer = weak_viewer.lock (); + shared_ptr<const GLVideoView> gl; + if (viewer) { + gl = std::dynamic_pointer_cast<const GLVideoView>(viewer->video_view()); + } if (!gl) { add (_("OpenGL version"), true); |
