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


On 24/04/12 08:56, Noel Grandin wrote:
Hi

This series of patches converts various datastructures in the SW module 
from SV*PTRARR to std::vector, std::set, and boost::ptr_set variously.

so the first patch, which Caolan already pushed, causes a segfault in
dbaccess_complex, because of a double free in
SwXTextView::removeSelectionChangeListener: the
boost::ptr_vector::erase() actually deletes the element.

it would of course be nice if the f..ine documentation would mention
that erase() will delete the element, but i can't find that fact
mentioned here:

http://www.boost.org/doc/libs/1_49_0/libs/ptr_container/doc/ptr_sequence_adapter.html

actually in this case putting a uno::Reference into boost::ptr_vector
looks kind of silly to me, a std::vector would be sufficient, which also
fixes the crash ...

... but then i remembered that there is actually a much better container
for the special purpose of storing UNO listeners, namely
::cppu::OInterfaceContainerHelper, and using that gets rid of a lot of
boilerplate here.

i'll review the rest of the patches soonish...


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.