Skip to content

Commit 147e944

Browse files
committed
[GEN][ZH] Remove the now obsolete MEMORY_POOL_DELETEINSTANCE_VISIBILITY macro (#870)
1 parent 8bd6d81 commit 147e944

File tree

4 files changed

+6
-35
lines changed

4 files changed

+6
-35
lines changed

Generals/Code/GameEngine/Include/Common/GameMemory.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -914,22 +914,6 @@ class MemoryPoolObjectHolder
914914
};
915915

916916

917-
// ----------------------------------------------------------------------------
918-
/**
919-
Sometimes you want to make a class's destructor protected so that it can only
920-
be destroyed under special circumstances. MemoryPoolObject short-circuits this
921-
by making the destructor always be protected, and the true delete technique
922-
(namely, deleteInstance) always public by default. You can simulate the behavior
923-
you really want by including this macro
924-
*/
925-
#define MEMORY_POOL_DELETEINSTANCE_VISIBILITY(ARGVIS)\
926-
ARGVIS: \
927-
static void deleteInstance(MemoryPoolObject* object) { \
928-
MemoryPoolObject::deleteInstance(object); \
929-
} \
930-
public:
931-
932-
933917
#define EMPTY_DTOR(CLASS) inline CLASS::~CLASS() { }
934918

935919
#endif // _GAME_MEMORY_H_

Generals/Code/GameEngine/Include/GameLogic/Object.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ class Object : public Thing, public Snapshot
158158
{
159159

160160
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(Object, "ObjectPool" )
161-
/// destructor is non-public in order to require the use of TheGameLogic->destroyObject()
162-
MEMORY_POOL_DELETEINSTANCE_VISIBILITY(protected)
163161

164162
public:
165163

@@ -765,6 +763,9 @@ class Object : public Thing, public Snapshot
765763

766764
}; // end class Object
767765

766+
// deleteInstance is not meant to be used with Object in order to require the use of TheGameLogic->destroyObject()
767+
void deleteInstance(Object* object) CPP_11(= delete);
768+
768769
// describe an object as an AsciiString: e.g. "Object 102 (KillerBuggy) [GLARocketBuggy, owned by player 2 (GLAIntroPlayer)]"
769770
AsciiString DebugDescribeObject(const Object *obj);
770771

GeneralsMD/Code/GameEngine/Include/Common/GameMemory.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -912,21 +912,6 @@ class MemoryPoolObjectHolder
912912
};
913913

914914

915-
/**
916-
Sometimes you want to make a class's destructor protected so that it can only
917-
be destroyed under special circumstances. MemoryPoolObject short-circuits this
918-
by making the destructor always be protected, and the true delete technique
919-
(namely, deleteInstance) always public by default. You can simulate the behavior
920-
you really want by including this macro
921-
*/
922-
#define MEMORY_POOL_DELETEINSTANCE_VISIBILITY(ARGVIS)\
923-
ARGVIS: \
924-
static void deleteInstance(MemoryPoolObject* object) { \
925-
MemoryPoolObject::deleteInstance(object); \
926-
} \
927-
public:
928-
929-
930915
#define EMPTY_DTOR(CLASS) inline CLASS::~CLASS() { }
931916

932917

GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,6 @@ class Object : public Thing, public Snapshot
164164
{
165165

166166
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(Object, "ObjectPool" )
167-
/// destructor is non-public in order to require the use of TheGameLogic->destroyObject()
168-
MEMORY_POOL_DELETEINSTANCE_VISIBILITY(protected)
169167

170168
public:
171169

@@ -811,6 +809,9 @@ class Object : public Thing, public Snapshot
811809

812810
}; // end class Object
813811

812+
// deleteInstance is not meant to be used with Object in order to require the use of TheGameLogic->destroyObject()
813+
void deleteInstance(Object* object) CPP_11(= delete);
814+
814815
// describe an object as an AsciiString: e.g. "Object 102 (KillerBuggy) [GLARocketBuggy, owned by player 2 (GLAIntroPlayer)]"
815816
AsciiString DebugDescribeObject(const Object *obj);
816817

0 commit comments

Comments
 (0)