1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0029355: OCCT 6.9.1 persistence restored in OCCT 7.2.0 not working

Auxiliary classes StdObjMgt_ReadData::Object and StdObjMgt_WriteData::Object are renamed to "ObjectSentry" (to better reflect their nature); constructor is made explicit to ensure that such objects are always created intentionally.
These objects are instantiated explicitly in the body of relevant functions, instead of implicit creation as temporary objects when function requires such object as argument.
Variable used to get char from stream is nullified in several places in FSD_File and other classes, to avoid possible usage of uninitialized memory in case if stream is bad.
This commit is contained in:
abv
2017-12-02 11:24:58 +03:00
committed by bugmaster
parent 67160f4e79
commit 472433e2c7
18 changed files with 210 additions and 142 deletions

View File

@@ -49,8 +49,10 @@ public:
};
inline StdObjMgt_ReadData& operator >>
(StdObjMgt_ReadData::Object theReadData, Poly_Triangle& theTriangle)
(StdObjMgt_ReadData& theReadData, Poly_Triangle& theTriangle)
{
StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
Standard_Integer N1, N2, N3;
theReadData >> N1 >> N2 >> N3;
theTriangle.Set (N1, N2, N3);
@@ -58,8 +60,10 @@ inline StdObjMgt_ReadData& operator >>
}
inline StdObjMgt_WriteData& operator <<
(StdObjMgt_WriteData::Object theWriteData, const Poly_Triangle& theTriangle)
(StdObjMgt_WriteData& theWriteData, const Poly_Triangle& theTriangle)
{
StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
Standard_Integer N1, N2, N3;
theTriangle.Get(N1, N2, N3);
theWriteData << N1 << N2 << N3;