/*
- * Copyright (c) 2019 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.
template<typename T>
int ReadFile(const std::string& filename, std::streampos& fileSize, Dali::Vector<T>& memblock, Dali::FileLoader::FileType fileType)
{
- int errorCode = 0;
- std::ifstream * file;
+ int errorCode = 0;
+ 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\"\n", filename.c_str() );
}
+ delete file;
+
return errorCode;
}