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
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to