summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-04-25 15:07:54 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-04-26 09:53:47 +0200
commit7df948695e5be0077fd9d7d8bc8e25072c345890 (patch)
tree1f97d30b12e5bd3d64bd2ff20cddd68dc6ea45c9 /chart2
parent2c8a9d8a6e0933bb717d800e6ddfb2b0c6db1f96 (diff)
Resolves: tdf#107372 set opengl context when using opengl functions
even if they are teardown ones Change-Id: Ie222d3ffb2b555c0013d7346552d3fc76ec87d9b Reviewed-on: https://gerrit.libreoffice.org/36948 Tested-by: Jenkins <ci@libreoffice.org> Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/charttypes/GL3DBarChart.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 0f96e878bb04..8c547b99e90c 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -592,8 +592,13 @@ GL3DBarChart::~GL3DBarChart()
joinRenderThread();
- if(mbValidContext)
+ if (mbValidContext)
+ {
mpWindow->setRenderer(nullptr);
+ mpWindow->getContext().makeCurrent();
+ mpRenderer.reset();
+ mpWindow->getContext().resetCurrent();
+ }
}
void GL3DBarChart::create3DShapes(const std::vector<std::unique_ptr<VDataSeries> >& rDataSeriesContainer,
@@ -1123,6 +1128,9 @@ void GL3DBarChart::contextDestroyed()
{
SharedResourceAccess aResGuard(maCond1, maCond2);
osl::MutexGuard aGuard(maMutex);
+ mpWindow->getContext().makeCurrent();
+ mpRenderer.reset();
+ mpWindow->getContext().resetCurrent();
mbValidContext = false;
}