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:
@@ -32,9 +32,3 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_DataStructureManager,MMgt_TShared)
|
||||
//-Constructors
|
||||
Graphic3d_DataStructureManager::Graphic3d_DataStructureManager () {
|
||||
}
|
||||
|
||||
//-Destructors
|
||||
|
||||
void Graphic3d_DataStructureManager::Destroy () {
|
||||
|
||||
}
|
||||
|
@@ -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:
|
||||
|
@@ -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
|
||||
|
@@ -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();
|
||||
|
@@ -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();
|
||||
|
@@ -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.
|
||||
|
Reference in New Issue
Block a user