diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-01-22 12:02:39 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-22 13:54:22 +0000 |
commit | 5301985417557627eb6e67cea26caf9688fd3920 (patch) | |
tree | b134e6717f36e1c5d649990f87942303c9bf0bb4 /opencl | |
parent | db2991d15950d30fd4202ad86ae78dc12fcee9ed (diff) |
cppcheck: memleak (false positive)
but manage ownership from start
Change-Id: I22d855d89bd93c56fbbcc1fb64e757fc950aa791
Reviewed-on: https://gerrit.libreoffice.org/33391
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'opencl')
-rw-r--r-- | opencl/source/openclwrapper.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx index 7b9d3ab3f8dd..796289362472 100644 --- a/opencl/source/openclwrapper.cxx +++ b/opencl/source/openclwrapper.cxx @@ -218,16 +218,15 @@ std::vector<std::shared_ptr<osl::File> > binaryGenerated( const char * clFileNam assert(pDevID == gpuEnv.mpDevID); OString fileName = createFileName(gpuEnv.mpDevID, clFileName); - osl::File* pNewFile = new osl::File(rtl::OStringToOUString(fileName, RTL_TEXTENCODING_UTF8)); + auto pNewFile = std::make_shared<osl::File>(rtl::OStringToOUString(fileName, RTL_TEXTENCODING_UTF8)); if(pNewFile->open(osl_File_OpenFlag_Read) == osl::FileBase::E_None) { - aGeneratedFiles.push_back(std::shared_ptr<osl::File>(pNewFile)); + aGeneratedFiles.push_back(pNewFile); SAL_INFO("opencl.file", "Opening binary file '" << fileName << "' for reading: success"); } else { SAL_INFO("opencl.file", "Opening binary file '" << fileName << "' for reading: FAIL"); - delete pNewFile; } return aGeneratedFiles; |