diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-02-02 15:17:52 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-02-02 15:17:52 +0100 |
commit | 5595ee701eab0fef0683c93e3c99788ab1b08520 (patch) | |
tree | f65921d6b5b0c8c988fa37eb4dc57e2879d25bf2 /bridges | |
parent | 19c0eff34a5e1de4f3aff723b7750d4e01d4ba6d (diff) |
loplugin:useuniqueptr
Change-Id: I3a246a22baaac8195dc1b94c42994de7d80e8336
Diffstat (limited to 'bridges')
-rw-r--r-- | bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx index 15a12d58fc77..180828b69c3f 100644 --- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx +++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx @@ -236,6 +236,9 @@ void #pragma warning( disable : 4237 ) #include <sal/config.h> + +#include <memory> + #include <malloc.h> #include <new.h> #include <typeinfo.h> @@ -617,7 +620,7 @@ RaiseInfo::RaiseInfo(typelib_TypeDescription * pTD)throw () // 2.Pass: Get the total needed memory for class ExceptionType // (with embedded type_info) and keep the sizes for each instance // is stored in allocated int array - int *exceptionTypeSizeArray = new int[nLen]; + auto exceptionTypeSizeArray = std::unique_ptr<int[]>(new int[nLen]); nLen = 0; for (pCompTD = reinterpret_cast<typelib_CompoundTypeDescription*>(pTD); @@ -697,9 +700,6 @@ RaiseInfo::RaiseInfo(typelib_TypeDescription * pTD)throw () } // Final check: end of address calculation must be end of mem assert(etMem + etMemOffset == pCode + totalSize); - - // remove array - delete[] exceptionTypeSizeArray; } #if !defined LEAK_STATIC_DATA |