summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-04-19 17:37:07 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-04-19 17:37:07 +0200
commit846c47fb0faaca505fec785db90384c093818db4 (patch)
tree69d104ca5f4c7ff30a30e866434682ff2db49776 /svl
parent3241d0125e7a17528a956e89bab21efc498b0587 (diff)
loplugin:useuniqueptr (clang-cl)
Change-Id: Ia854d1d6a8bd5f5f9a87aebb57337a992606c03f
Diffstat (limited to 'svl')
-rw-r--r--svl/source/svdde/ddesvr.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx
index 8ece1071cf20..36fd9da26d90 100644
--- a/svl/source/svdde/ddesvr.cxx
+++ b/svl/source/svdde/ddesvr.cxx
@@ -17,10 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#define UNICODE
#include "ddeimp.hxx"
#include <algorithm>
+#include <memory>
#include <comphelper/string.hxx>
#include <rtl/ustring.hxx>
#include <svl/svdde.hxx>
@@ -111,9 +111,9 @@ HDDEDATA CALLBACK DdeInternal::SvrCallback(
if( !nTopics )
return nullptr;
- HSZPAIR* pPairs = new HSZPAIR [nTopics + 1];
+ auto pPairs = std::unique_ptr<HSZPAIR[]>(new HSZPAIR [nTopics + 1]);
- HSZPAIR* q = pPairs;
+ HSZPAIR* q = pPairs.get();
for (DdeServices::iterator aI = rAll.begin(); aI != rAll.end(); ++aI)
{
pService = *aI;
@@ -143,10 +143,10 @@ HDDEDATA CALLBACK DdeInternal::SvrCallback(
q->hszSvc = nullptr;
q->hszTopic = nullptr;
HDDEDATA h = DdeCreateDataHandle(
- pInst->hDdeInstSvr, reinterpret_cast<LPBYTE>(pPairs),
+ pInst->hDdeInstSvr,
+ reinterpret_cast<LPBYTE>(pPairs.get()),
sizeof(HSZPAIR) * (nTopics+1),
0, nullptr, nCbType, 0);
- delete [] pPairs;
return h;
}