summaryrefslogtreecommitdiff
path: root/src/wx/system_information_dialog.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/system_information_dialog.cc
parent10f36696805235c774890a4618b7187dd75750d4 (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.cc7
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);