Commit 8cd56cf6 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Make sure to call FileSaver::finalize



We may leak resources otherwise.

Change-Id: Ic09f58bd47cbf283e22f17f2c3393ca03c5dfacf
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@digia.com>
parent c6cbc97a
......@@ -289,13 +289,11 @@ bool TextFileFormat::writeFile(const QString &fileName, QString plainText, QStri
}
Utils::FileSaver saver(fileName, fileMode);
if (saver.hasError()) {
*errorString = saver.errorString();
return false;
}
if (!saver.hasError()) {
if (hasUtf8Bom && codec->name() == "UTF-8")
saver.write("\xef\xbb\xbf", 3);
saver.write(codec->fromUnicode(plainText));
}
const bool ok = saver.finalize(errorString);
if (debug)
qDebug().nospace() << Q_FUNC_INFO << fileName << ' ' << *this << ' ' << plainText.size()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment