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

0027067: Avoid use of virtual methods for implementation of destructors in legacy classes

Redundant methods Delete() and Desroy(), created in CDL as a hack to define destructor for the class, are removed; their definitions are converted to definition of destructors. In a couple of places methods Destroy() are preserved (bug made non-virtual) because they are called explicitly.
This commit is contained in:
abv
2016-01-03 07:11:46 +03:00
parent 18f7c9a5c2
commit e6f550da99
116 changed files with 150 additions and 467 deletions

View File

@@ -150,5 +150,11 @@ Interface_EntityIterator::Interface_EntityIterator ()
return thelist;
}
void Interface_EntityIterator::Destroy ()
void Interface_EntityIterator::Destroy ()
{ thecurr.Nullify(); } // redevient vide !
Interface_EntityIterator::~Interface_EntityIterator()
{
Destroy();
}

View File

@@ -90,11 +90,10 @@ public:
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) Content() const;
//! Clears data of iteration
Standard_EXPORT virtual void Destroy();
Standard_EXPORT virtual ~Interface_EntityIterator() { Destroy();}
Standard_EXPORT void Destroy();
//! Destructor
Standard_EXPORT virtual ~Interface_EntityIterator();
protected:

View File

@@ -566,11 +566,11 @@ Handle(Standard_Transient) Interface_FileReaderTool::LoadedEntity
//=======================================================================
//function : Destroy
//function : ~Interface_FileReaderTool
//purpose :
//=======================================================================
void Interface_FileReaderTool::Destroy()
Interface_FileReaderTool::~Interface_FileReaderTool()
{}
void Interface_FileReaderTool::Clear()

View File

@@ -175,8 +175,7 @@ public:
//! else (in case of syntactic fail)
Standard_EXPORT virtual Standard_Boolean AnalyseRecord (const Standard_Integer num, const Handle(Standard_Transient)& anent, Handle(Interface_Check)& acheck) = 0;
Standard_EXPORT virtual void Destroy();
Standard_EXPORT virtual ~Interface_FileReaderTool() { Destroy(); }
Standard_EXPORT virtual ~Interface_FileReaderTool();
//! Ends file reading after reading all the entities
//! default is doing nothing; redefinable as necessary