[Bug 216446] editors/libreoffice: sfx2_classification test crashes during build with clang/libc++ 4.0
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Sun Jan 29 00:59:25 UTC 2017
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216446
--- Comment #7 from Dimitry Andric <dim at FreeBSD.org> ---
Created attachment 179388
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=179388&action=edit
Fix libreoffice's sfx2_classification unit test
Here is a patch that fixes the sfx2_classification unit test, at least for me.
The resulting libreoffice installs and runs OK, at least with some light
testing.
I am not completely sure why this fix works though. My suspicion is that the
reference returned from pDocShell->getDocProperties() is a temporary object,
which gets passed to a SfxClassificationHelper object, but it is destroyed or
invalidated before it is being accessed in SfxClassificationHelper. By storing
the return value from pDocShell->getDocProperties() in a local object, the
destruction or invalidation is postponed to the end of the
SwEditShell::SetClassification() function.
There are a few other places in the source where this pattern is repeated, in
some cases storing the getDocProperties() result in a local object, in other
cases directly passing it to another constructor, so there is not much
consistency.
Somebody who understands libreoffice's class structure and object reference
mechanism better should attempt to explain this more coherently. Until that
moment, this patch seems to do the trick...
--
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
More information about the freebsd-office
mailing list