summaryrefslogtreecommitdiff
path: root/src/wx/gl_video_view.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/wx/gl_video_view.cc')
-rw-r--r--src/wx/gl_video_view.cc14
1 files changed, 8 insertions, 6 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));
}
}