diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-17 12:04:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-17 12:58:33 +0200 |
commit | 01b9fdb2712e1a10e9a24b11976bb4fb94ac5bd9 (patch) | |
tree | ca63ab42450d81ea3a4b2df04f704ed47db07bb7 /tools | |
parent | d728492f4aa195fd4aec3ddb116879de76a95c6d (diff) |
loplugin:useuniqueptr in tools/inetmsg.hxx
Change-Id: Ifdf0da7f59af1777f214cbafeb75b46136775f67
Reviewed-on: https://gerrit.libreoffice.org/43450
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/inet/inetmsg.cxx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index 704c44fad587..b3dc426ad7b6 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -218,12 +218,6 @@ INetMIMEMessage::INetMIMEMessage() INetMIMEMessage::~INetMIMEMessage() { - for (auto i: m_aHeaderList) { - delete i; - } - for (auto i: aChildren) { - delete i; - } } void INetMIMEMessage::SetMIMEVersion (const OUString& rVersion) @@ -293,12 +287,13 @@ void INetMIMEMessage::EnableAttachMultipartFormDataChild() SetContentTransferEncoding("7bit"); } -void INetMIMEMessage::AttachChild(INetMIMEMessage& rChildMsg) +void INetMIMEMessage::AttachChild(std::unique_ptr<INetMIMEMessage> pChildMsg) { + assert(IsContainer()); if (IsContainer()) { - rChildMsg.pParent = this; - aChildren.push_back( &rChildMsg ); + pChildMsg->pParent = this; + aChildren.push_back( std::move(pChildMsg) ); } } |