-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revise saving .omap files #2276
Comments
Note that the description of
which would allow to use However:
Thus using |
But the interaction of XML classes and direct writes is a sensitive point. |
Is there a reason (other than performance) for not always using the XML class access in the else path?
|
You want avoid additional memory pressure when saving under memory pressure. |
Three examples for data corruption:
|
In the past 18 months two corrupted .omap files were reported where the analysis showed that the corruption happened while writing object coordinates.
Although Mapper uses the
QSaveFile
class to ensure (by using a temporary file) that an .omap file is only overwritten when saving was successful, there is a weakness when saving object coordinates.void XmlElementWriter::write(const MapCoordVector& coords)
inxml_stream_util.cpp
bypasses the safe writeData mechanism by directly accessing QIODevice
Although the return value of
exportImplementation()
below is checked, the actual implementation inbool XMLFileExporter::exportImplementation()
always returnstrue
.managed_file->commit()
will not be aware of any errors that occur when not usingQSaveFile::writeData(const char *data, qint64 len)
(see qsavefile.cpp).
The text was updated successfully, but these errors were encountered: