diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-07-25 17:02:21 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-08-10 10:56:54 +0200 |
commit | 4c41c030f6c8dc74814e0d8bf05d5fa5adc5e8ad (patch) | |
tree | e86821824de3e78fc340ca3af79a2ee82848d735 /svx | |
parent | 5996769043ba06d534f113e106d0ba28d723f925 (diff) |
tdf#118860 svx opengl: avoid SalBitmap creation without solar mutex
The bugdoc has 2 slides. When switching to the second slide, the graphic
is loaded in the background, but OpenGLSalBitmap::Create() can't work
correctly if the caller doesn't own the solar mutex.
This already asserts in OpenGLContext::prepareForYield() in a less
obvious way.
Focus on the correctness, so just hold the solar mutex during the whole
ImportGrpahic() call. If it turns out that the purpose of running this
on a thread is to avoid synchronous network traffic, then the data could
be first copied to a memory stream, and only then take the lock + import
the graphic.
(cherry picked from commit 919ccaba419531d689231b76a43ab29c6a9ec65a)
Change-Id: I88203c12b4e7a5f2b689928c01e2ba953c5b13c5
Reviewed-on: https://gerrit.libreoffice.org/58126
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit 2038ab9d4cbb7282172a65352e4ed1a852404b29)
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdograf.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 7939dd1e9ebb..5829d508f687 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -94,6 +94,9 @@ const Graphic ImpLoadLinkedGraphic( const OUString& aFileName, const OUString& a aFilterData[ 0 ].Name = "CreateNativeLink"; aFilterData[ 0 ].Value <<= true; + // Need to own the solar mutex while creating a SalBitmap. + SolarMutexGuard aGuard; + // #i123042# for e.g SVG the path is needed, so hand it over here. I have no real idea // what consequences this may have; maybe this is not handed over by purpose here. Not // handing it over means that any GraphicFormat that internally needs a path as base |