Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On 09/25/2011 01:48 PM, Mathias Bauer wrote:
The differentiation between hard and soft refererences would require a
solid understanding of the relationships of all objects. With this
understanding you could most probably fix the existing code without
refcounting also: a weak reference always could be replaced by a
callback function that tells possible consumers of an object that this
object is going to die (and so manually sets the pointer to Null), a
pattern that can be found in OOo's code in other places (e.g.
SfxBroadcaster or SwNotify objects). But of course using refcounting
here would make the code clearer.

And another advantage of weak refs over notifications is that the former tend to behave correctly in multi-threaded scenarios while the latter tend to misbehave.

-Stephan

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.