summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-11-04 00:15:30 +0100
committerCarl Hetherington <cth@carlh.net>2020-11-04 00:15:30 +0100
commitcfba7e0f9f20e68397e41d8f979e7723425ec51b (patch)
treef7e5c229b9decc712d1e5e8946c49366beaba529 /src
parent21e78df3645193f696873bdf29d39ea9f772395e (diff)
Fix crash on Linux (and maybe others).
Calling _canvas->SetCurrent() without the canvas being on screen causes a crash on Linux (and maybe elsewhere).
Diffstat (limited to 'src')
-rw-r--r--src/wx/gl_video_view.cc9
1 files 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 ();
}