/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
int ReadFile(const std::string& filename, std::streampos& fileSize, Dali::Vector<T>& memblock, Dali::FileLoader::FileType fileType)
{
int errorCode = 0;
- std::ifstream* file;
+ std::ifstream* file{nullptr};
if(fileType == Dali::FileLoader::BINARY)
{
file->read(reinterpret_cast<char*>(memblock.Begin()), fileSize);
file->close();
- delete file;
-
errorCode = 1;
}
else
DALI_LOG_ERROR("file open failed for: \"%s\", error : %s\n", filename.c_str(), strerror_r(errno, buf, 512));
}
+ delete file;
+
return errorCode;
}