diff options
author | Robin Gareus <robin@gareus.org> | 2016-03-01 14:43:28 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-03-01 14:43:28 +0100 |
commit | 4384aff43f4ec0691ce866b2637aab66ed580f16 (patch) | |
tree | ba9a9d6c98ecbe476cb1e80046a8d6f84586b316 /libs | |
parent | 36d30f8c8968f408ae36e382a2fb35158224f799 (diff) |
protect current_request with request_queue_lock
Diffstat (limited to 'libs')
-rw-r--r-- | libs/canvas/wave_view.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libs/canvas/wave_view.cc b/libs/canvas/wave_view.cc index 3effd9943f..b8d369a2df 100644 --- a/libs/canvas/wave_view.cc +++ b/libs/canvas/wave_view.cc @@ -944,7 +944,10 @@ WaveView::queue_get_image (boost::shared_ptr<const ARDOUR::Region> region, frame /* this will stop rendering in progress (which might otherwise be long lived) for any current request. */ - current_request->cancel (); + Glib::Threads::Mutex::Lock lm (request_queue_lock); + if (current_request) { + current_request->cancel (); + } } start_drawing_thread (); @@ -1001,6 +1004,11 @@ WaveView::generate_image (boost::shared_ptr<WaveViewThreadRequest> req, bool in_ req->channel, req->samples_per_pixel); + if (req->should_stop()) { + cerr << "Request stopped after reading peaks\n"; + return; + } + req->image = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, n_peaks, req->height); // http://cairographics.org/manual/cairo-Image-Surfaces.html#cairo-image-surface-create @@ -1491,11 +1499,12 @@ WaveView::cancel_my_render_request () const * ever starting up. */ + Glib::Threads::Mutex::Lock lm (request_queue_lock); + if (current_request) { current_request->cancel (); } - Glib::Threads::Mutex::Lock lm (request_queue_lock); /* now remove it from the queue and reset our request pointer so that have no outstanding request (that we know about) |