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

@@ -32,9 +32,3 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_DataStructureManager,MMgt_TShared)
//-Constructors
Graphic3d_DataStructureManager::Graphic3d_DataStructureManager () {
}
//-Destructors
void Graphic3d_DataStructureManager::Destroy () {
}

View File

@@ -34,16 +34,6 @@ class Graphic3d_DataStructureManager : public MMgt_TShared
public:
//! Deletes the manager <me>.
Standard_EXPORT virtual void Destroy();
~Graphic3d_DataStructureManager()
{
Destroy();
}
DEFINE_STANDARD_RTTIEXT(Graphic3d_DataStructureManager,MMgt_TShared)
protected:

View File

@@ -98,10 +98,10 @@ Graphic3d_Structure::Graphic3d_Structure (const Handle(Graphic3d_StructureManage
}
//=============================================================================
//function : Destroy
//function : ~Graphic3d_Structure
//purpose :
//=============================================================================
void Graphic3d_Structure::Destroy()
Graphic3d_Structure::~Graphic3d_Structure()
{
// as myFirstStructureManager can be already destroyed,
// avoid attempts to access it

View File

@@ -99,11 +99,7 @@ public:
//! Suppresses the structure <me>.
//! It will be erased at the next screen update.
Standard_EXPORT virtual void Destroy();
~Graphic3d_Structure()
{
Destroy();
}
Standard_EXPORT ~Graphic3d_Structure();
//! Displays the structure <me> in all the views of the visualiser.
Standard_EXPORT virtual void Display();

View File

@@ -101,8 +101,8 @@ Standard_Integer Limit = Graphic3d_StructureManager::Limit ();
//-Destructors
void Graphic3d_StructureManager::Destroy () {
Graphic3d_StructureManager::~Graphic3d_StructureManager ()
{
myDisplayedStructure.Clear ();
myHighlightedStructure.Clear ();
myDefinedViews.Clear();

View File

@@ -70,11 +70,7 @@ public:
Standard_EXPORT Graphic3d_StructureManager (const Handle(Graphic3d_GraphicDriver)& theDriver);
//! Deletes the manager <me>.
Standard_EXPORT virtual void Destroy();
~Graphic3d_StructureManager()
{
Destroy();
}
Standard_EXPORT ~Graphic3d_StructureManager();
//! Modifies the default attributes for lines
//! in the visualiser.