Skip to content

Commit

Permalink
Remove explicit file.close because QFile already handles this
Browse files Browse the repository at this point in the history
  • Loading branch information
MrStevns committed Nov 29, 2024
1 parent 85b43e6 commit 279e74b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 10 deletions.
3 changes: 0 additions & 3 deletions core_lib/src/graphics/vector/vectorimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ bool VectorImage::read(QString filePath)
{
return false;
}
ScopeGuard fileScope([&] {
file.close();
});

QDomDocument doc;
if (!doc.setContent(&file)) return false; // this is not a XML file
Expand Down
4 changes: 0 additions & 4 deletions core_lib/src/soundplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ void SoundPlayer::init(SoundClip* clip)

QFile file(clip->fileName());
file.open(QIODevice::ReadOnly);
ScopeGuard fileScope([&] {
file.close();
});


mBuffer.setData(file.readAll());
mBuffer.open(QBuffer::ReadOnly);
Expand Down
3 changes: 0 additions & 3 deletions core_lib/src/structure/filemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@ Object* FileManager::load(const QString& sFileName)
handleOpenProjectError(Status::ERROR_FILE_CANNOT_OPEN, dd);
return nullptr;
}
ScopeGuard fileScope([&] {
file.close();
});

dd << "Main XML exists: Yes";

Expand Down

0 comments on commit 279e74b

Please sign in to comment.