fdo#70090: Avoid race in copy vs. modification of aRetval Sequence
If, in the original code, aRetval[0] was computed before calling new MaskPrmitive2D (as apparently happens with Clang), no COW-copy of aRetval's internals was created (as the refcount was still 1), so MaskPrimitive2D's maChildren would share the Sequence internals with aRetval, so would end up having itself as its children after the assignment. Change-Id: I145ca429fdfae2ea555b8c754b407a81b989d45b
This commit is contained in:
parent
ccd2240332
commit
57d9c96d96
@ -304,9 +304,10 @@ namespace drawinglayer
|
|||||||
basegfx::B2DPolygon aMaskPolygon(basegfx::tools::createUnitPolygon());
|
basegfx::B2DPolygon aMaskPolygon(basegfx::tools::createUnitPolygon());
|
||||||
aMaskPolygon.transform(rTransform);
|
aMaskPolygon.transform(rTransform);
|
||||||
|
|
||||||
aRetval[0] = new MaskPrimitive2D(
|
Primitive2DReference mask = new MaskPrimitive2D(
|
||||||
basegfx::B2DPolyPolygon(aMaskPolygon),
|
basegfx::B2DPolyPolygon(aMaskPolygon),
|
||||||
aRetval);
|
aRetval);
|
||||||
|
aRetval[0] = mask;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user