Skip to content

[CORE][GEN][ZH] Add missing virtual destructors for virtual classes #1049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Core/Libraries/Source/WWVegas/WWDownload/Download.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class CDownload
m_predictionTimes[i] = 0;
}
}
~CDownload() { delete m_Ftp; }
virtual ~CDownload() { delete m_Ftp; }

public:
virtual HRESULT PumpMessages();
Expand Down
2 changes: 2 additions & 0 deletions Core/Libraries/Source/profile/internal_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
class ProfileResultFileCSV: public ProfileResultInterface
{
ProfileResultFileCSV(void) {}
virtual ~ProfileResultFileCSV() {}

void WriteThread(ProfileFuncLevel::Thread &thread);

Expand Down Expand Up @@ -84,6 +85,7 @@ class ProfileResultFileDOT: public ProfileResultInterface
private:

ProfileResultFileDOT(const char *fileName, const char *frameName, int foldThreshold);
virtual ~ProfileResultFileDOT() {}

struct FoldHelper
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class CampaignManager : public Snapshot
{
public:
CampaignManager( void );
~CampaignManager( void );
virtual ~CampaignManager( void );

// snapshot methods
virtual void crc( Xfer *xfer ) { }
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/GameEngine/Include/GameLogic/AI.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class TAiData : public Snapshot
{
public:
TAiData();
~TAiData();
virtual ~TAiData();

void addSideInfo(AISideInfo *info);
void addFactionBuildList(AISideBuildList *buildList);
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/GameEngine/Include/GameLogic/AIPathfind.h
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ class Pathfinder : PathfindServicesInterface, public Snapshot

public:
Pathfinder( void );
~Pathfinder() ;
virtual ~Pathfinder();

void reset( void ); ///< Reset system in preparation for new map

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ConnectionManager
{
public:
ConnectionManager();
~ConnectionManager();
virtual ~ConnectionManager();

virtual void init(); ///< Initialize this instance.
virtual void reset(); ///< Take this instance back to the initial state.
Expand Down
1 change: 1 addition & 0 deletions Generals/Code/GameEngine/Include/GameNetwork/GameInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ class SkirmishGameInfo : public GameInfo, public Snapshot
for (Int i = 0; i< MAX_SLOTS; ++i)
setSlotPointer(i, &m_skirmishSlot[i]);
}
virtual ~SkirmishGameInfo(){}
};

extern SkirmishGameInfo *TheSkirmishGameInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class GameSpyStagingRoom : public GameInfo

public:
GameSpyStagingRoom();
virtual ~GameSpyStagingRoom(){}
virtual void reset( void );

void cleanUpSlotPointers(void);
Expand Down
1 change: 1 addition & 0 deletions Generals/Code/GameEngine/Include/GameNetwork/LANGameInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class LANGameInfo : public GameInfo

public:
LANGameInfo();
virtual ~LANGameInfo(){}
void setSlot( Int slotNum, LANGameSlot slotInfo ); ///< Set the slot state (human, open, AI, etc)
LANGameSlot* getLANSlot( Int slotNum ); ///< Get the slot
const LANGameSlot* getConstLANSlot( Int slotNum ) const; ///< Get the slot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class W3DProjectedShadow : public Shadow

public:
W3DProjectedShadow(void);
~W3DProjectedShadow(void);
virtual ~W3DProjectedShadow(void);
void setRenderObject( RenderObjClass *robj) {m_robj=robj;}
void setObjPosHistory(const Vector3 &pos) {m_lastObjPosition=pos;} ///<position of object when projection matrix was updated.
void setTexture(Int lightIndex,W3DShadowTexture *texture) {m_shadowTexture[lightIndex]=texture;} ///<textur with light's shadow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class W3DVolumetricShadow : public Shadow
public:

W3DVolumetricShadow( void );
~W3DVolumetricShadow( void );
virtual ~W3DVolumetricShadow( void );

protected:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class WaterTracksObj
public:

WaterTracksObj(void);
~WaterTracksObj(void);
virtual ~WaterTracksObj(void);

virtual void Render(void) {}; ///<draw this object
virtual void Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const; ///<bounding sphere of this object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class W3DRenderObjectSnapshot : public Snapshot
friend W3DGhostObject;

W3DRenderObjectSnapshot(RenderObjClass *m_parentRobj, DrawableInfo *drawInfo, Bool cloneParentRobj = TRUE);
~W3DRenderObjectSnapshot() {REF_PTR_RELEASE(m_robj);}
virtual ~W3DRenderObjectSnapshot() {REF_PTR_RELEASE(m_robj);}
inline void update(RenderObjClass *robj, DrawableInfo *drawInfo, Bool cloneParentRobj=TRUE); ///<refresh the current snapshot with latest state
inline void addToScene(void); ///< add this fogged renderobject to the scene.
protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class CampaignManager : public Snapshot
{
public:
CampaignManager( void );
~CampaignManager( void );
virtual ~CampaignManager( void );

// snapshot methods
virtual void crc( Xfer *xfer ) { }
Expand Down
2 changes: 1 addition & 1 deletion GeneralsMD/Code/GameEngine/Include/GameLogic/AI.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class TAiData : public Snapshot
{
public:
TAiData();
~TAiData();
virtual ~TAiData();

void addSideInfo(AISideInfo *info);
void addFactionBuildList(AISideBuildList *buildList);
Expand Down
2 changes: 1 addition & 1 deletion GeneralsMD/Code/GameEngine/Include/GameLogic/AIPathfind.h
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ class Pathfinder : PathfindServicesInterface, public Snapshot

public:
Pathfinder( void );
~Pathfinder() ;
virtual ~Pathfinder();

void reset( void ); ///< Reset system in preparation for new map

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ConnectionManager
{
public:
ConnectionManager();
~ConnectionManager();
virtual ~ConnectionManager();

virtual void init(); ///< Initialize this instance.
virtual void reset(); ///< Take this instance back to the initial state.
Expand Down
1 change: 1 addition & 0 deletions GeneralsMD/Code/GameEngine/Include/GameNetwork/GameInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ class SkirmishGameInfo : public GameInfo, public Snapshot
for (Int i = 0; i< MAX_SLOTS; ++i)
setSlotPointer(i, &m_skirmishSlot[i]);
}
virtual ~SkirmishGameInfo(){}
};

extern SkirmishGameInfo *TheSkirmishGameInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class GameSpyStagingRoom : public GameInfo

public:
GameSpyStagingRoom();
virtual ~GameSpyStagingRoom(){}
virtual void reset( void );

void cleanUpSlotPointers(void);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class LANGameInfo : public GameInfo

public:
LANGameInfo();
virtual ~LANGameInfo(){}
void setSlot( Int slotNum, LANGameSlot slotInfo ); ///< Set the slot state (human, open, AI, etc)
LANGameSlot* getLANSlot( Int slotNum ); ///< Get the slot
const LANGameSlot* getConstLANSlot( Int slotNum ) const; ///< Get the slot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class W3DProjectedShadow : public Shadow

public:
W3DProjectedShadow(void);
~W3DProjectedShadow(void);
virtual ~W3DProjectedShadow(void);
void setRenderObject( RenderObjClass *robj) {m_robj=robj;}
void setObjPosHistory(const Vector3 &pos) {m_lastObjPosition=pos;} ///<position of object when projection matrix was updated.
void setTexture(Int lightIndex,W3DShadowTexture *texture) {m_shadowTexture[lightIndex]=texture;} ///<textur with light's shadow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ friend class BaseHeightMapRenderObjClass;
public:

W3DPropBuffer(void);
~W3DPropBuffer(void);
virtual ~W3DPropBuffer(void);
/// Add a prop at location. Name is the w3d model name.
void addProp(Int id, Coord3D location, Real angle, Real scale, const AsciiString &modelName);
/// Remove a prop.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class W3DTreeTextureClass : public TextureClass
public:

W3DTreeBuffer(void);
~W3DTreeBuffer(void);
virtual ~W3DTreeBuffer(void);
/// Add a tree at location. Name is the w3d model name.
void addTree(DrawableID id, Coord3D location, Real scale, Real angle,
Real randomScaleAmount, const W3DTreeDrawModuleData *data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class W3DVolumetricShadow : public Shadow
public:

W3DVolumetricShadow( void );
~W3DVolumetricShadow( void );
virtual ~W3DVolumetricShadow( void );

protected:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class WaterTracksObj
public:

WaterTracksObj(void);
~WaterTracksObj(void);
virtual ~WaterTracksObj(void);

virtual void Render(void) {}; ///<draw this object
virtual void Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const; ///<bounding sphere of this object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class W3DRenderObjectSnapshot : public Snapshot
friend W3DGhostObject;

W3DRenderObjectSnapshot(RenderObjClass *m_parentRobj, DrawableInfo *drawInfo, Bool cloneParentRobj = TRUE);
~W3DRenderObjectSnapshot() {REF_PTR_RELEASE(m_robj);}
virtual ~W3DRenderObjectSnapshot() {REF_PTR_RELEASE(m_robj);}
inline void update(RenderObjClass *robj, DrawableInfo *drawInfo, Bool cloneParentRobj=TRUE); ///<refresh the current snapshot with latest state
inline void addToScene(void); ///< add this fogged renderobject to the scene.
protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class TextureLoadTaskClass : public TextureLoadTaskListNodeClass


TextureLoadTaskClass(void);
~TextureLoadTaskClass(void);
virtual ~TextureLoadTaskClass(void);

static TextureLoadTaskClass * Create (TextureBaseClass *tc, TaskType type, PriorityType priority);
static void Delete_Free_Pool (void);
Expand Down
Loading