Get the raw pointer on creation of the FileStream to avoid any accidental usage of the unique_ptr.

This commit is contained in:
rh101 2021-04-26 17:31:34 +10:00
parent c7aa1d4f00
commit 19995f863b
1 changed files with 2 additions and 2 deletions

View File

@ -174,7 +174,7 @@ bool FontFreeType::createFontObject(const std::string &fontName, float fontSize)
auto fullPath = FileUtils::getInstance()->fullPathForFilename(fontName); auto fullPath = FileUtils::getInstance()->fullPathForFilename(fontName);
if (fullPath.empty()) return false; if (fullPath.empty()) return false;
auto fs = FileUtils::getInstance()->openFileStream(fullPath, FileStream::Mode::READ); auto fs = FileUtils::getInstance()->openFileStream(fullPath, FileStream::Mode::READ).release();
if (!fs) if (!fs)
{ {
return false; return false;
@ -187,7 +187,7 @@ bool FontFreeType::createFontObject(const std::string &fontName, float fontSize)
fts->size = fs->tell(); fts->size = fs->tell();
fs->seek(0, SEEK_SET); fs->seek(0, SEEK_SET);
fts->descriptor.pointer = fs.release(); fts->descriptor.pointer = fs;
FT_Open_Args args = { 0 }; FT_Open_Args args = { 0 };
args.flags = FT_OPEN_STREAM; args.flags = FT_OPEN_STREAM;