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


will do.

On 2012-02-08 16:44, Eike Rathke wrote:
Hi Noel,

On Wednesday, 2012-02-08 13:05:42 +0200, Noel Grandin wrote:

Attached path converts usage of SV_DECL_PTRARR_DEL in
sc/inc/detdata.hxx and associated code to std::vector.
SV_DECL_PTRARR_DEL is one of those containers that take ownership of the
objects pointed to, as you noticed and introduced deleting elements and
DeleteAndDestroy() method, and as such it is a candidate for
boost::ptr_vector instead of std::vector which makes workarounds like
DeleteAndDestroy() unnecessary, erase()'ing an element will also delete
the object. Care has to be taken when adding elements, ptr_vector if an
element could not be added deletes the object, so a dangling pointer
might be left and could be accessed, and a further delete would be
attempted twice.

I'd appreciate if you could rework the patch to use boost::ptr_vector
instead.

Thanks
   Eike


Disclaimer: http://www.peralex.com/disclaimer.html



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.