On Thu, 2010-09-30 at 09:05 +0200, David Tardon wrote:
On Thu, Sep 30, 2010 at 02:19:03PM +0900, Seo Sanghyeon wrote:
Attached patch removes DynamicList and migrate its users from
DynamicList<T> to std::vector<T *>.
<vector> header is included. "list.hxx" is not removed because it is
still used for List class.
Hi,
std::vector<T*> is not a correct replacement for DynamicList<T>, because
the latter manages the lifetime of its members, which std::vector does
not do, therefore every remove causes a memory leak.
You should consider using boost::ptr_vector<T> for that. That one
stores pointers and it manages the lifecycle of stored instances.
OOo's internal boost already delivers headers for the ptr_container
family of boost. So no need to modify the boost module in order to use
ptr_vector.
Kohei
--
Kohei Yoshida, LibreOffice hacker, Calc
<kyoshida@novell.com>
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.