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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user