[Libreoffice] [REVIEW 3-4] fdo#39510 crash on closing document with footnotes

Stephan Bergmann sbergman at redhat.com
Mon Sep 26 00:18:03 PDT 2011


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


More information about the LibreOffice mailing list