[PATCH] convert detdata.cxx in SC module to std::vector
Noel Grandin
noel at peralex.com
Wed Feb 8 06:49:27 PST 2012
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
More information about the LibreOffice
mailing list