diff options
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/gl_video_view.cc | 14 | ||||
| -rw-r--r-- | src/wx/gl_video_view.h | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc index d47ad87f4..ebf4098e4 100644 --- a/src/wx/gl_video_view.cc +++ b/src/wx/gl_video_view.cc @@ -57,7 +57,6 @@ GLVideoView::GLVideoView (FilmViewer* viewer, wxWindow *parent) : VideoView (viewer) , _have_storage (false) , _vsync_enabled (false) - , _thread (0) , _playing (false) , _one_shot (false) { @@ -105,9 +104,12 @@ GLVideoView::GLVideoView (FilmViewer* viewer, wxWindow *parent) GLVideoView::~GLVideoView () { - _thread->interrupt (); - _thread->join (); - delete _thread; + try { + _thread.interrupt (); + _thread.join (); + } catch (...) { + + } glDeleteTextures (1, &_id); } @@ -386,7 +388,7 @@ GLVideoView::request_one_shot () void GLVideoView::create () { - if (!_thread) { - _thread = new boost::thread (boost::bind(&GLVideoView::thread, this)); + if (!_thread.joinable()) { + _thread = boost::thread (boost::bind(&GLVideoView::thread, this)); } } diff --git a/src/wx/gl_video_view.h b/src/wx/gl_video_view.h index 2f3c8c2a1..84d97c751 100644 --- a/src/wx/gl_video_view.h +++ b/src/wx/gl_video_view.h @@ -68,7 +68,7 @@ private: boost::optional<dcp::Size> _size; bool _have_storage; bool _vsync_enabled; - boost::thread* _thread; + boost::thread _thread; boost::mutex _playing_mutex; boost::condition _playing_condition; |
