summaryrefslogtreecommitdiff
path: root/drawinglayer/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-02-19 10:59:03 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-02-19 13:18:00 +0100
commite81f4656225cd474086340481a4505e3e932f8e6 (patch)
treefe0de0b8af5793414c3007135f004e1a4a415ee5 /drawinglayer/source
parent043e090069b3bd4c660743f6f639d002f403a7b8 (diff)
crashtesting: bump refcount during setBuffered2DDecomposition
otherwise if another thread drops the refcounf to 0 while setBuffered2DDecomposition is in flight the object goes away underneath us. Change-Id: I65d458306bee0c4f2e80fd2925d22cf121920fc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163591 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'drawinglayer/source')
-rw-r--r--drawinglayer/source/primitive2d/BufferedDecompositionGroupPrimitive2D.cxx2
-rw-r--r--drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx2
2 files changed, 4 insertions, 0 deletions
diff --git a/drawinglayer/source/primitive2d/BufferedDecompositionGroupPrimitive2D.cxx b/drawinglayer/source/primitive2d/BufferedDecompositionGroupPrimitive2D.cxx
index a24816ad5f3a..4a09d0490ce9 100644
--- a/drawinglayer/source/primitive2d/BufferedDecompositionGroupPrimitive2D.cxx
+++ b/drawinglayer/source/primitive2d/BufferedDecompositionGroupPrimitive2D.cxx
@@ -53,7 +53,9 @@ namespace drawinglayer::primitive2d
{
void flushBufferedDecomposition(BufferedDecompositionGroupPrimitive2D& rTarget)
{
+ rTarget.acquire();
rTarget.setBuffered2DDecomposition(Primitive2DContainer());
+ rTarget.release();
}
const Primitive2DContainer&
diff --git a/drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx b/drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx
index 61eb34251913..ba8a4606cc83 100644
--- a/drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx
+++ b/drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx
@@ -53,7 +53,9 @@ namespace drawinglayer::primitive2d
{
void flushBufferedDecomposition(BufferedDecompositionPrimitive2D& rTarget)
{
+ rTarget.acquire();
rTarget.setBuffered2DDecomposition(nullptr);
+ rTarget.release();
}
const Primitive2DReference& BufferedDecompositionPrimitive2D::getBuffered2DDecomposition() const