Skip to content

Commit

Permalink
bfVFS: fix usage in XMLWriter.cpp and XMLProperties.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
majcosta committed Dec 15, 2024
1 parent f5da061 commit 18f4ac6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions Utils/XMLProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,10 @@ bool vfs::PropertyContainer::initFromXMLFile(vfs::Path const& sFileName, vfs::Pr
}
else
{
vfs::File* rfile = new vfs::File(sFileName);
auto file{vfs::OpenReadFile(sFileName)};
delete_file = true;
file = vfs::ReadableFile_t::cast(rfile);
if(!file->openRead())
{
delete file;
return false;
}
}
Expand Down
6 changes: 3 additions & 3 deletions Utils/XMLWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ bool XMLWriter::writeToFile(vfs::Path const& sFileName)
catch(vfs::Exception& ex)
{
SGP_ERROR(ex.what());
vfs::File file(sFileName);
if(file.openWrite(true,true))
auto file{vfs::OpenWriteFile(sFileName)};
if(file->openWrite(true,true))
{
return writeToFile(vfs::WritableFile_t::cast(&file));
return writeToFile(file.file());
}
}
return false;
Expand Down

0 comments on commit 18f4ac6

Please sign in to comment.