summaryrefslogtreecommitdiff
path: root/basegfx/source/matrix
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-08-25 20:27:34 +0200
committerMichael Stahl <mstahl@redhat.com>2017-08-25 21:25:38 +0200
commit0157f98861d589caa60f1ef3dacebb0137d23afe (patch)
tree7569e8a74fe09992e4d3558575365f6f7e731018 /basegfx/source/matrix
parentc5616014bb288b89610b8b59b9515a06577a8c41 (diff)
basegfx: remove global 3D IdentityMatrix thread safety hazard
On a tinderbox, CppunitTest_chart2_export crashed in basegfx::B3DHomMatrix::isEqual(), with other threads in other basegfx code. The UnsafeRefCountingPolicy on the global IdentityMatrix is likely the problem. Change-Id: Ib142c6f286453d61bd948fb0c184cd68fd313b0f
Diffstat (limited to 'basegfx/source/matrix')
-rw-r--r--basegfx/source/matrix/b3dhommatrix.cxx13
1 files changed, 3 insertions, 10 deletions
diff --git a/basegfx/source/matrix/b3dhommatrix.cxx b/basegfx/source/matrix/b3dhommatrix.cxx
index 1a88c8b5c777..e6a2bd3b4f88 100644
--- a/basegfx/source/matrix/b3dhommatrix.cxx
+++ b/basegfx/source/matrix/b3dhommatrix.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <rtl/instance.hxx>
#include <basegfx/matrix/b3dhommatrix.hxx>
#include <hommatrixtemplate.hxx>
#include <basegfx/vector/b3dvector.hxx>
@@ -30,11 +29,8 @@ namespace basegfx
{
};
- namespace { struct IdentityMatrix : public rtl::Static< B3DHomMatrix::ImplType,
- IdentityMatrix > {}; }
-
- B3DHomMatrix::B3DHomMatrix() :
- mpImpl( IdentityMatrix::get() ) // use common identity matrix
+ B3DHomMatrix::B3DHomMatrix()
+ : mpImpl() // identity
{
}
@@ -81,15 +77,12 @@ namespace basegfx
bool B3DHomMatrix::isIdentity() const
{
- if(mpImpl.same_object(IdentityMatrix::get()))
- return true;
-
return mpImpl->isIdentity();
}
void B3DHomMatrix::identity()
{
- mpImpl = IdentityMatrix::get();
+ *mpImpl = Impl3DHomMatrix();
}
bool B3DHomMatrix::invert()