Kaydet (Commit) 53019854 authored tarafından Jochen Nitschke's avatar Jochen Nitschke Kaydeden (comit) Noel Grandin

cppcheck: memleak (false positive)

but manage ownership from start

Change-Id: I22d855d89bd93c56fbbcc1fb64e757fc950aa791
Reviewed-on: https://gerrit.libreoffice.org/33391Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst db2991d1
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment