From cfba7e0f9f20e68397e41d8f979e7723425ec51b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 4 Nov 2020 00:15:30 +0100 Subject: [PATCH] Fix crash on Linux (and maybe others). Calling _canvas->SetCurrent() without the canvas being on screen causes a crash on Linux (and maybe elsewhere). --- src/wx/gl_video_view.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc index 79ede0d8e..d33882821 100644 --- a/src/wx/gl_video_view.cc +++ b/src/wx/gl_video_view.cc @@ -112,16 +112,17 @@ GLVideoView::check_for_butler_errors () void GLVideoView::update () { - if (!_thread.joinable()) { - _thread = boost::thread (boost::bind(&GLVideoView::thread, this)); - } - { boost::mutex::scoped_lock lm (_canvas_mutex); if (!_canvas->IsShownOnScreen()) { return; } } + + if (!_thread.joinable()) { + _thread = boost::thread (boost::bind(&GLVideoView::thread, this)); + } + request_one_shot (); } -- 2.30.2