diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-07-23 23:08:05 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-07-24 02:04:40 +0200 |
commit | f62e9f40d28f0aa61109217de83d60d44a60585f (patch) | |
tree | 68c23fdcc77c1e03d8766a0b483bc572e012c0e7 /chart2 | |
parent | 2480abb1819188263a72b6d37e7511486f354b0b (diff) |
prevent that deadlock by only rpotecting shared resources
Again update may not be protected bt the mutex.
Change-Id: I8b9862c8ecafad75eea3b9e041d3063532f7bf63
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/charttypes/GL3DBarChart.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx index 4809a2f0efd3..2116ac7f0103 100644 --- a/chart2/source/view/charttypes/GL3DBarChart.cxx +++ b/chart2/source/view/charttypes/GL3DBarChart.cxx @@ -687,11 +687,14 @@ void GL3DBarChart::moveToCorner() void GL3DBarChart::scroll(long nDelta) { - osl::MutexGuard aGuard(maMutex); + { + osl::MutexGuard aGuard(maMutex); + + glm::vec3 maDir = glm::normalize(maCameraPosition - maCameraDirection); + maCameraPosition -= (float((nDelta/10)) * maDir); + mpCamera->setPosition(maCameraPosition); + } - glm::vec3 maDir = glm::normalize(maCameraPosition - maCameraDirection); - maCameraPosition -= (float((nDelta/10)) * maDir); - mpCamera->setPosition(maCameraPosition); update(); } |