Browse Source

Get rid of DEL() and FREE() macros.

Part of CoreLibExe must die.
Darryl Pogue 13 years ago committed by Adam Johnson
parent
commit
8a3f0cfd5b
  1. 6
      Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp
  2. 2
      Sources/Plasma/Apps/plUruLauncher/Main.cpp
  3. 3
      Sources/Plasma/CoreLib/hsMalloc.h
  4. 4
      Sources/Plasma/CoreLib/hsStlUtils.h
  5. 2
      Sources/Plasma/CoreLib/hsUtils.cpp
  6. 10
      Sources/Plasma/FeatureLib/pfCharacter/pfMarkerMgr.cpp
  7. 6
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
  8. 2
      Sources/Plasma/FeatureLib/pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp
  9. 4
      Sources/Plasma/FeatureLib/pfGameMgr/ClimbingWall/pfGmClimbingWall.cpp
  10. 4
      Sources/Plasma/FeatureLib/pfGameMgr/Heek/pfGmHeek.cpp
  11. 6
      Sources/Plasma/FeatureLib/pfGameMgr/Marker/pfGmMarker.cpp
  12. 4
      Sources/Plasma/FeatureLib/pfGameMgr/TicTacToe/pfGmTicTacToe.cpp
  13. 2
      Sources/Plasma/FeatureLib/pfGameMgr/VarSync/pfGmVarSync.cpp
  14. 16
      Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp
  15. 2
      Sources/Plasma/FeatureLib/pfGameScoreMgr/pfGameScoreMgr.cpp
  16. 6
      Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.cpp
  17. 2
      Sources/Plasma/FeatureLib/pfPython/cyAccountManagement.cpp
  18. 4
      Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp
  19. 6
      Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp
  20. 2
      Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp
  21. 2
      Sources/Plasma/FeatureLib/pfPython/pySDL.cpp
  22. 6
      Sources/Plasma/FeatureLib/pfPython/pyVault.cpp
  23. 12
      Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.cpp
  24. 2
      Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp
  25. 12
      Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp
  26. 12
      Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp
  27. 4
      Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp
  28. 2
      Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.cpp
  29. 6
      Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.cpp
  30. 2
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNt.cpp
  31. 2
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtFile.cpp
  32. 6
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtSocket.cpp
  33. 2
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xFile.cpp
  34. 8
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xSocket.cpp
  35. 2
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xThread.cpp
  36. 2
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Dns.cpp
  37. 2
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Thread.cpp
  38. 2
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceIo.cpp
  39. 6
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceLog.cpp
  40. 2
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceThread.cpp
  41. 4
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceTimer.cpp
  42. 16
      Sources/Plasma/NucleusLib/pnCrashExe/Win32/pnCreError.cpp
  43. 10
      Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.cpp
  44. 2
      Sources/Plasma/NucleusLib/pnIniExe/Private/Win32/pnW32IniChange.cpp
  45. 2
      Sources/Plasma/NucleusLib/pnIniExe/Private/pnIniSrv.cpp
  46. 6
      Sources/Plasma/NucleusLib/pnMail/pnMail.cpp
  47. 2
      Sources/Plasma/NucleusLib/pnNetCli/pnNcChannel.cpp
  48. 14
      Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp
  49. 4
      Sources/Plasma/NucleusLib/pnNetDiag/pnNdDns.cpp
  50. 2
      Sources/Plasma/NucleusLib/pnNetDiag/pnNdIcmp.cpp
  51. 16
      Sources/Plasma/NucleusLib/pnNetDiag/pnNdTcp.cpp
  52. 4
      Sources/Plasma/NucleusLib/pnNetDiag/pnNetDiag.cpp
  53. 2
      Sources/Plasma/NucleusLib/pnNetDiag/pnNetSys.cpp
  54. 2
      Sources/Plasma/NucleusLib/pnNetLog/pnNlCli.cpp
  55. 12
      Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp
  56. 8
      Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h
  57. 6
      Sources/Plasma/NucleusLib/pnOraLib/pnOraLib.cpp
  58. 10
      Sources/Plasma/NucleusLib/pnSimpleNet/pnSimpleNet.cpp
  59. 14
      Sources/Plasma/NucleusLib/pnSqlLib/Private/pnSqlConn.cpp
  60. 4
      Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Sync.cpp
  61. 8
      Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.cpp
  62. 4
      Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp
  63. 6
      Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.h
  64. 2
      Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.h
  65. 4
      Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPriQ.h
  66. 2
      Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRef.h
  67. 6
      Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSkipList.h
  68. 2
      Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.cpp
  69. 4
      Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h
  70. 2
      Sources/Plasma/PubUtilLib/plAudioCore/plBufferedFileReader.cpp
  71. 6
      Sources/Plasma/PubUtilLib/plAudioCore/plOGGCodec.cpp
  72. 4
      Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp
  73. 8
      Sources/Plasma/PubUtilLib/plCompression/plZlibStream.cpp
  74. 4
      Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp
  75. 4
      Sources/Plasma/PubUtilLib/plMessage/plConsoleMsg.h
  76. 2
      Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp
  77. 2
      Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeLeaver.cpp
  78. 4
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp
  79. 8
      Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp
  80. 4
      Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp
  81. 14
      Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp
  82. 4
      Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglCsr.cpp
  83. 4
      Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp
  84. 8
      Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp
  85. 8
      Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp
  86. 2
      Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp
  87. 62
      Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp
  88. 12
      Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp

6
Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp

@ -654,7 +654,7 @@ static void ProcessManifest (void * param) {
} }
} }
} }
DEL(mr); delete mr;
AtomicAdd(&s_perf[kPerfThreadTaskCount], -1); AtomicAdd(&s_perf[kPerfThreadTaskCount], -1);
} }
@ -920,7 +920,7 @@ void UruPrepProc (void * param) {
while(ManifestFile *mf = s_manifestQueue.Head()) while(ManifestFile *mf = s_manifestQueue.Head())
{ {
DEL(mf); delete mf;
} }
// If s_patchError, we don't wait around for s_numFiles // If s_patchError, we don't wait around for s_numFiles
// to drop to zero because it never does for reasons // to drop to zero because it never does for reasons
@ -1030,4 +1030,4 @@ void UruStartProc (void * param) {
{ {
info->startCallback(kStatusError, nil); info->startCallback(kStatusError, nil);
} }
} }

2
Sources/Plasma/Apps/plUruLauncher/Main.cpp

@ -409,7 +409,7 @@ static void DispatchEvents (HWND hwnd) {
DISPATCH(SetBytesRemaining); DISPATCH(SetBytesRemaining);
DEFAULT_FATAL(event->type); DEFAULT_FATAL(event->type);
} }
DEL(event); // unlinks from list delete event; // unlinks from list
} }
#undef DISPATCH #undef DISPATCH
} }

3
Sources/Plasma/CoreLib/hsMalloc.h

@ -52,7 +52,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "HeadSpin.h" #include "HeadSpin.h"
/**************************************************************************** /****************************************************************************
* *
* Allocation functions * Allocation functions
@ -168,7 +167,6 @@ inline void CDECL operator delete (void *, void *) {}
#define ALLOC(b) MemAlloc(b, 0, __FILE__, __LINE__) #define ALLOC(b) MemAlloc(b, 0, __FILE__, __LINE__)
#define ALLOCZERO(b) MemAlloc(b, kMemZero, __FILE__, __LINE__) #define ALLOCZERO(b) MemAlloc(b, kMemZero, __FILE__, __LINE__)
#define ALLOCFLAGS(b, f) MemAlloc(b, (f), __FILE__, __LINE__) #define ALLOCFLAGS(b, f) MemAlloc(b, (f), __FILE__, __LINE__)
#define FREE(p) MemFree(p, 0)
#define FREEFLAGS(p, f) MemFree(p, (f)) #define FREEFLAGS(p, f) MemFree(p, (f))
#define REALLOC(p, b) MemRealloc(p, b, 0, __FILE__, __LINE__) #define REALLOC(p, b) MemRealloc(p, b, 0, __FILE__, __LINE__)
#define REALLOCFLAGS(p, b, f) MemRealloc(p, b, (f), __FILE__, __LINE__) #define REALLOCFLAGS(p, b, f) MemRealloc(p, b, (f), __FILE__, __LINE__)
@ -185,7 +183,6 @@ inline void CDECL operator delete (void *, void *) {}
#define NEW(t) new(MemAlloc(sizeof(t), 0, __FILE__, __LINE__)) t #define NEW(t) new(MemAlloc(sizeof(t), 0, __FILE__, __LINE__)) t
#define NEWFLAGS(t, f) new(MemAlloc(sizeof(t), (f), __FILE__, __LINE__)) t #define NEWFLAGS(t, f) new(MemAlloc(sizeof(t), (f), __FILE__, __LINE__)) t
#define NEWZERO(t) new(MemAlloc(sizeof(t), kMemZero, __FILE__, __LINE__)) t #define NEWZERO(t) new(MemAlloc(sizeof(t), kMemZero, __FILE__, __LINE__)) t
#define DEL(t) delete (t)
#endif // __cplusplus #endif // __cplusplus

4
Sources/Plasma/CoreLib/hsStlUtils.h

@ -114,12 +114,12 @@ public:
void deallocate(pointer _Ptr, size_type) void deallocate(pointer _Ptr, size_type)
{ // deallocate object at _Ptr, ignore size { // deallocate object at _Ptr, ignore size
FREE(_Ptr); free(_Ptr);
} }
pointer allocate(size_type _Count) pointer allocate(size_type _Count)
{ // allocate array of _Count elements { // allocate array of _Count elements
return (pointer)ALLOC(_Count * sizeof(_Ty)); return (pointer)malloc(_Count * sizeof(_Ty));
} }
pointer allocate(size_type _Count, const void*) pointer allocate(size_type _Count, const void*)

2
Sources/Plasma/CoreLib/hsUtils.cpp

@ -237,7 +237,7 @@ char* hsStrcpy(char dst[], const char src[])
if (dst == nil) if (dst == nil)
{ {
int count = hsStrlen(src); int count = hsStrlen(src);
dst = (char *)ALLOC(count + 1); dst = (char *)malloc(count + 1);
memcpy(dst, src, count); memcpy(dst, src, count);
dst[count] = 0; dst[count] = 0;
return dst; return dst;

10
Sources/Plasma/FeatureLib/pfCharacter/pfMarkerMgr.cpp

@ -103,7 +103,7 @@ void pfMarkerMgr::IShutdown()
while (curMarker != fMarkers.end()) while (curMarker != fMarkers.end())
{ {
curMarker->second->Remove(); curMarker->second->Remove();
DEL(curMarker->second); delete curMarker->second;
++curMarker; ++curMarker;
} }
fMarkers.clear(); fMarkers.clear();
@ -165,7 +165,7 @@ void pfMarkerMgr::AddMarker(double x, double y, double z, uint32_t id, bool just
{ {
// delete existing one if we're changing its location // delete existing one if we're changing its location
fMarkers[id]->Remove(); fMarkers[id]->Remove();
DEL(fMarkers[id]); delete fMarkers[id];
} }
hsPoint3 pos((float)x, (float)y, (float)z); hsPoint3 pos((float)x, (float)y, (float)z);
@ -178,7 +178,7 @@ void pfMarkerMgr::RemoveMarker(uint32_t id)
if (fMarkers.find(id) == fMarkers.end()) if (fMarkers.find(id) == fMarkers.end())
return; return;
fMarkers[id]->Remove(); fMarkers[id]->Remove();
DEL(fMarkers[id]); delete fMarkers[id];
fMarkers.erase(id); fMarkers.erase(id);
} }
@ -188,7 +188,7 @@ void pfMarkerMgr::RemoveAllMarkers()
while (curMarker != fMarkers.end()) while (curMarker != fMarkers.end())
{ {
curMarker->second->Remove(); curMarker->second->Remove();
DEL(curMarker->second); delete curMarker->second;
++curMarker; ++curMarker;
} }
fMarkers.clear(); fMarkers.clear();
@ -326,4 +326,4 @@ hsBool pfMarkerMgr::MsgReceive(plMessage* msg)
} }
return hsKeyedObject::MsgReceive(msg); return hsKeyedObject::MsgReceive(msg);
} }

6
Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp

@ -6090,7 +6090,7 @@ PF_CONSOLE_CMD(Age, ShowSDL, "", "Prints the age SDL values")
plStateDataRecord * rec = NEWZERO(plStateDataRecord); plStateDataRecord * rec = NEWZERO(plStateDataRecord);
if (!VaultAgeGetAgeSDL(rec)) { if (!VaultAgeGetAgeSDL(rec)) {
PrintString("Age SDL not found"); PrintString("Age SDL not found");
DEL(rec); delete rec;
return; return;
} }
@ -6106,14 +6106,14 @@ PF_CONSOLE_CMD(Age, ShowSDL, "", "Prints the age SDL values")
char * str = simple->GetAsString(j); char * str = simple->GetAsString(j);
StrPack(line, str, arrsize(line)); StrPack(line, str, arrsize(line));
StrPack(line, ",", arrsize(line)); StrPack(line, ",", arrsize(line));
FREE(str); free(str);
} }
PrintString(line); PrintString(line);
plStatusLog::AddLineS("ShowSDL.log", "%s", line); plStatusLog::AddLineS("ShowSDL.log", "%s", line);
} }
} }
DEL(rec); delete rec;
} }
PF_CONSOLE_CMD( Age, GetElapsedDays, "string agedefnfile", "Gets the elapsed days and fractions" ) PF_CONSOLE_CMD( Age, GetElapsedDays, "string agedefnfile", "Gets the elapsed days and fractions" )

2
Sources/Plasma/FeatureLib/pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp

@ -203,7 +203,7 @@ pfGmBlueSpiral::pfGmBlueSpiral (
//============================================================================ //============================================================================
pfGmBlueSpiral::~pfGmBlueSpiral () { pfGmBlueSpiral::~pfGmBlueSpiral () {
DEL(internal); delete internal;
} }
//============================================================================ //============================================================================

4
Sources/Plasma/FeatureLib/pfGameMgr/ClimbingWall/pfGmClimbingWall.cpp

@ -211,7 +211,7 @@ pfGmClimbingWall::pfGmClimbingWall (
//============================================================================ //============================================================================
pfGmClimbingWall::~pfGmClimbingWall () { pfGmClimbingWall::~pfGmClimbingWall () {
DEL(internal); delete internal;
} }
//============================================================================ //============================================================================
@ -347,4 +347,4 @@ void pfGmClimbingWall::Panic () {
msg.transId = 0; msg.transId = 0;
GameMgrSend(&msg); GameMgrSend(&msg);
} }

4
Sources/Plasma/FeatureLib/pfGameMgr/Heek/pfGmHeek.cpp

@ -245,7 +245,7 @@ pfGmHeek::pfGmHeek (
//============================================================================ //============================================================================
pfGmHeek::~pfGmHeek () { pfGmHeek::~pfGmHeek () {
DEL(internal); delete internal;
} }
//============================================================================ //============================================================================
@ -343,4 +343,4 @@ void pfGmHeek::SequenceFinished (EHeekSeqFinished seq) {
msg.seqFinished = (uint8_t)seq; msg.seqFinished = (uint8_t)seq;
GameMgrSend(&msg); GameMgrSend(&msg);
} }

6
Sources/Plasma/FeatureLib/pfGameMgr/Marker/pfGmMarker.cpp

@ -229,7 +229,7 @@ void IMarker::RecvGameDeleted (const Srv2Cli_Marker_GameDeleted & msg, void * pa
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
if (!msg.failed) if (!msg.failed)
DEL(gameCli); // we're done delete gameCli; // we're done
} }
//============================================================================ //============================================================================
@ -280,7 +280,7 @@ pfGmMarker::pfGmMarker (
//============================================================================ //============================================================================
pfGmMarker::~pfGmMarker () { pfGmMarker::~pfGmMarker () {
DEL(internal); delete internal;
} }
//============================================================================ //============================================================================
@ -464,4 +464,4 @@ void pfGmMarker::CaptureMarker (unsigned long markerID) {
msg.markerID = markerID; msg.markerID = markerID;
GameMgrSend(&msg); GameMgrSend(&msg);
} }

4
Sources/Plasma/FeatureLib/pfGameMgr/TicTacToe/pfGmTicTacToe.cpp

@ -174,7 +174,7 @@ void ITicTacToe::RecvGameOver (const Srv2Cli_TTT_GameOver & msg, void * param) {
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
DEL(gameCli); // we're done delete gameCli; // we're done
} }
//============================================================================ //============================================================================
@ -210,7 +210,7 @@ pfGmTicTacToe::pfGmTicTacToe (
//============================================================================ //============================================================================
pfGmTicTacToe::~pfGmTicTacToe () { pfGmTicTacToe::~pfGmTicTacToe () {
DEL(internal); delete internal;
} }
//============================================================================ //============================================================================

2
Sources/Plasma/FeatureLib/pfGameMgr/VarSync/pfGmVarSync.cpp

@ -202,7 +202,7 @@ pfGmVarSync::pfGmVarSync (
//============================================================================ //============================================================================
pfGmVarSync::~pfGmVarSync () { pfGmVarSync::~pfGmVarSync () {
DEL(internal); delete internal;
} }
//============================================================================ //============================================================================

16
Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp

@ -148,7 +148,7 @@ static ARRAYOBJ(plKey) s_receivers;
static void ShutdownFactories () { static void ShutdownFactories () {
while (Factory * factory = s_factories.Head()) while (Factory * factory = s_factories.Head())
DEL(factory); delete factory;
} }
//============================================================================ //============================================================================
@ -200,7 +200,7 @@ void IGameMgr::RecvGameInstance (const Srv2Cli_GameMgr_GameInstance & msg, void
cli = internal->gameCli; cli = internal->gameCli;
} }
DEL(state); delete state;
} }
//============================================================================ //============================================================================
@ -228,7 +228,7 @@ void IGameMgr::Recv (GameMsgHeader * msg) {
void * param; void * param;
if (TransState * trans = s_trans.Find(msg->transId)) { if (TransState * trans = s_trans.Find(msg->transId)) {
param = trans->param; param = trans->param;
DEL(trans); delete trans;
} }
else { else {
param = nil; param = nil;
@ -280,13 +280,13 @@ pfGameMgrMsg::pfGameMgrMsg () {
//============================================================================ //============================================================================
pfGameMgrMsg::~pfGameMgrMsg () { pfGameMgrMsg::~pfGameMgrMsg () {
FREE(netMsg); free(netMsg);
} }
//============================================================================ //============================================================================
void pfGameMgrMsg::Set (const GameMsgHeader & msg) { void pfGameMgrMsg::Set (const GameMsgHeader & msg) {
netMsg = (GameMsgHeader *)ALLOC(msg.messageBytes); netMsg = (GameMsgHeader *)malloc(msg.messageBytes);
MemCopy(netMsg, &msg, msg.messageBytes); MemCopy(netMsg, &msg, msg.messageBytes);
} }
@ -307,13 +307,13 @@ pfGameCliMsg::pfGameCliMsg () {
//============================================================================ //============================================================================
pfGameCliMsg::~pfGameCliMsg () { pfGameCliMsg::~pfGameCliMsg () {
FREE(netMsg); free(netMsg);
} }
//============================================================================ //============================================================================
void pfGameCliMsg::Set (pfGameCli * cli, const GameMsgHeader & msg) { void pfGameCliMsg::Set (pfGameCli * cli, const GameMsgHeader & msg) {
netMsg = (GameMsgHeader *)ALLOC(msg.messageBytes); netMsg = (GameMsgHeader *)malloc(msg.messageBytes);
MemCopy(netMsg, &msg, msg.messageBytes); MemCopy(netMsg, &msg, msg.messageBytes);
gameCli = cli; gameCli = cli;
} }
@ -475,7 +475,7 @@ pfGameCli::pfGameCli (
//============================================================================ //============================================================================
pfGameCli::~pfGameCli () { pfGameCli::~pfGameCli () {
DEL(internal); delete internal;
} }
//============================================================================ //============================================================================

2
Sources/Plasma/FeatureLib/pfGameScoreMgr/pfGameScoreMgr.cpp

@ -112,7 +112,7 @@ void pfGameScoreMgr::RemoveCachedScore(unsigned scoreId)
{ {
if (GameScoreLink * link = fScores.Find(scoreId)) if (GameScoreLink * link = fScores.Find(scoreId))
{ {
DEL(link); delete link;
} }
} }

6
Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.cpp

@ -155,15 +155,15 @@ struct LocAgeInfo
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
static void * XMLCALL XmlMalloc (size_t size) { static void * XMLCALL XmlMalloc (size_t size) {
return ALLOC(size); return malloc(size);
} }
static void * XMLCALL XmlRealloc (void * ptr, size_t size) { static void * XMLCALL XmlRealloc (void * ptr, size_t size) {
return REALLOC(ptr, size); return realloc(ptr, size);
} }
static void XMLCALL XmlFree (void * ptr) { static void XMLCALL XmlFree (void * ptr) {
FREE(ptr); free(ptr);
} }
XML_Memory_Handling_Suite gHeapAllocator = { XML_Memory_Handling_Suite gHeapAllocator = {

2
Sources/Plasma/FeatureLib/pfPython/cyAccountManagement.cpp

@ -137,5 +137,5 @@ void cyAccountManagement::ChangePassword(const char* password)
{ {
wchar_t* wpassword = StrDupToUnicode(password); wchar_t* wpassword = StrDupToUnicode(password);
NetCommChangeMyPassword(wpassword); NetCommChangeMyPassword(wpassword);
FREE(wpassword); free(wpassword);
} }

4
Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp

@ -259,7 +259,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtSendRTChat, args, "Params: fromPlayer,toPlayer
wchar_t* msg = TRACKED_NEW wchar_t[size + 1]; msg[size] = 0; wchar_t* msg = TRACKED_NEW wchar_t[size + 1]; msg[size] = 0;
PyUnicode_AsWideChar((PyUnicodeObject*)message, msg, size); PyUnicode_AsWideChar((PyUnicodeObject*)message, msg, size);
uint32_t retval = cyMisc::SendRTChat(*fromPlayer, toPlayerList, msg, msgFlags); uint32_t retval = cyMisc::SendRTChat(*fromPlayer, toPlayerList, msg, msgFlags);
DEL(msg); delete msg;
return PyLong_FromUnsignedLong(retval); return PyLong_FromUnsignedLong(retval);
} }
else else
@ -553,4 +553,4 @@ void cyMisc::AddPlasmaMethods(std::vector<PyMethodDef> &methods)
AddPlasmaMethods2(methods); AddPlasmaMethods2(methods);
AddPlasmaMethods3(methods); AddPlasmaMethods3(methods);
AddPlasmaMethods4(methods); AddPlasmaMethods4(methods);
} }

6
Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp

@ -220,8 +220,8 @@ void pyAgeVault::AddChronicleEntry( const char * name, uint32_t type, const char
VaultAddAgeChronicleEntry(wEntryName, type, wEntryValue); VaultAddAgeChronicleEntry(wEntryName, type, wEntryValue);
FREE(wEntryName); free(wEntryName);
FREE(wEntryValue); free(wEntryValue);
} }
// AGE DEVICES. AKA IMAGERS, WHATEVER. // AGE DEVICES. AKA IMAGERS, WHATEVER.
@ -311,7 +311,7 @@ PyObject * pyAgeVault::GetAgeSDL() const
{ {
plStateDataRecord * rec = NEWZERO(plStateDataRecord); plStateDataRecord * rec = NEWZERO(plStateDataRecord);
if (!VaultAgeGetAgeSDL(rec)) { if (!VaultAgeGetAgeSDL(rec)) {
DEL(rec); delete rec;
PYTHON_RETURN_NONE; PYTHON_RETURN_NONE;
} }
else { else {

2
Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp

@ -51,7 +51,7 @@ pyDniInfoSource::pyDniInfoSource()
{} {}
pyDniInfoSource::~pyDniInfoSource() { pyDniInfoSource::~pyDniInfoSource() {
FREE(fAgeName); free(fAgeName);
} }
PyObject* pyDniInfoSource::GetAgeCoords( void ) PyObject* pyDniInfoSource::GetAgeCoords( void )

2
Sources/Plasma/FeatureLib/pfPython/pySDL.cpp

@ -56,7 +56,7 @@ pySDLStateDataRecord::pySDLStateDataRecord( plStateDataRecord * rec )
} }
pySDLStateDataRecord::~pySDLStateDataRecord() { pySDLStateDataRecord::~pySDLStateDataRecord() {
DEL(fRec); delete fRec;
} }
plStateDataRecord * pySDLStateDataRecord::GetRec() const plStateDataRecord * pySDLStateDataRecord::GetRec() const

6
Sources/Plasma/FeatureLib/pfPython/pyVault.cpp

@ -369,8 +369,8 @@ void pyVault::AddChronicleEntry( const char * name, uint32_t type, const char *
// Maybe we should insert a dummy into the tree? (currently hard) // Maybe we should insert a dummy into the tree? (currently hard)
VaultAddChronicleEntryAndWait(wEntryName, type, wEntryValue); VaultAddChronicleEntryAndWait(wEntryName, type, wEntryValue);
FREE(wEntryName); free(wEntryName);
FREE(wEntryValue); free(wEntryValue);
} }
@ -452,7 +452,7 @@ PyObject* pyVault::GetPsnlAgeSDL() const
if (sdl.GetStateDataRecord(rec, plSDL::kKeepDirty)) if (sdl.GetStateDataRecord(rec, plSDL::kKeepDirty))
result = pySDLStateDataRecord::New(rec); result = pySDLStateDataRecord::New(rec);
else else
DEL(rec); delete rec;
rvnSdl->DecRef(); rvnSdl->DecRef();
} }
rvnInfo->DecRef(); rvnInfo->DecRef();

12
Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.cpp

@ -70,8 +70,8 @@ pyVaultChronicleNode::pyVaultChronicleNode(int n)
} }
pyVaultChronicleNode::~pyVaultChronicleNode () { pyVaultChronicleNode::~pyVaultChronicleNode () {
FREE(ansiName); free(ansiName);
FREE(ansiValue); free(ansiValue);
} }
@ -86,7 +86,7 @@ void pyVaultChronicleNode::Chronicle_SetName( const char * text )
wchar_t * wStr = StrDupToUnicode(text); wchar_t * wStr = StrDupToUnicode(text);
VaultChronicleNode chron(fNode); VaultChronicleNode chron(fNode);
chron.SetEntryName(wStr); chron.SetEntryName(wStr);
FREE(wStr); free(wStr);
} }
const char * pyVaultChronicleNode::Chronicle_GetName( void ) const char * pyVaultChronicleNode::Chronicle_GetName( void )
@ -94,7 +94,7 @@ const char * pyVaultChronicleNode::Chronicle_GetName( void )
if (!fNode) if (!fNode)
return ""; return "";
FREE(ansiName); free(ansiName);
VaultChronicleNode chron(fNode); VaultChronicleNode chron(fNode);
ansiName = StrDupToAnsi(chron.entryName); ansiName = StrDupToAnsi(chron.entryName);
@ -109,7 +109,7 @@ void pyVaultChronicleNode::Chronicle_SetValue( const char * text )
wchar_t * wStr = StrDupToUnicode(text); wchar_t * wStr = StrDupToUnicode(text);
VaultChronicleNode chron(fNode); VaultChronicleNode chron(fNode);
chron.SetEntryValue(wStr); chron.SetEntryValue(wStr);
FREE(wStr); free(wStr);
} }
const char * pyVaultChronicleNode::Chronicle_GetValue( void ) const char * pyVaultChronicleNode::Chronicle_GetValue( void )
@ -117,7 +117,7 @@ const char * pyVaultChronicleNode::Chronicle_GetValue( void )
if (!fNode) if (!fNode)
return ""; return "";
FREE(ansiValue); free(ansiValue);
ansiValue = nil; ansiValue = nil;
VaultChronicleNode chron(fNode); VaultChronicleNode chron(fNode);

2
Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp

@ -245,7 +245,7 @@ void pyVaultImageNode::SetImageFromScrShot()
else { else {
access.SetImageData(nil, 0); access.SetImageData(nil, 0);
access.SetImageType(VaultImageNode::kNone); access.SetImageType(VaultImageNode::kNone);
DEL(fMipmap); delete fMipmap;
fMipmap = nil; fMipmap = nil;
} }
} }

12
Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp

@ -154,7 +154,7 @@ void pyVaultNode::pyVaultNodeOperationCallback::VaultOperationComplete( uint32_t
} }
} }
DEL(this); // commit hara-kiri delete this; // commit hara-kiri
} }
void pyVaultNode::pyVaultNodeOperationCallback::SetNode (RelVaultNode * rvn) { void pyVaultNode::pyVaultNodeOperationCallback::SetNode (RelVaultNode * rvn) {
@ -191,8 +191,8 @@ pyVaultNode::~pyVaultNode()
{ {
if (fNode) if (fNode)
fNode->DecRef("pyVaultNode"); fNode->DecRef("pyVaultNode");
FREE(fCreateAgeGuid); free(fCreateAgeGuid);
FREE(fCreateAgeName); free(fCreateAgeName);
} }
@ -335,7 +335,7 @@ const char * pyVaultNode::GetCreateAgeGuid( void )
return fCreateAgeGuid; return fCreateAgeGuid;
if (fNode) { if (fNode) {
fCreateAgeGuid = (char*)ALLOC(64); fCreateAgeGuid = (char*)malloc(64);
GuidToString(fNode->createAgeUuid, fCreateAgeGuid, 64); GuidToString(fNode->createAgeUuid, fCreateAgeGuid, 64);
} }
@ -383,7 +383,7 @@ void pyVaultNode::SetCreatorNodeID( uint32_t v )
void pyVaultNode::SetCreateAgeName( const char * v ) void pyVaultNode::SetCreateAgeName( const char * v )
{ {
FREE(fCreateAgeName); free(fCreateAgeName);
fCreateAgeName = nil; fCreateAgeName = nil;
ASSERT(fNode); ASSERT(fNode);
@ -394,7 +394,7 @@ void pyVaultNode::SetCreateAgeName( const char * v )
void pyVaultNode::SetCreateAgeGuid( const char * v ) void pyVaultNode::SetCreateAgeGuid( const char * v )
{ {
FREE(fCreateAgeGuid); free(fCreateAgeGuid);
fCreateAgeGuid = nil; fCreateAgeGuid = nil;
ASSERT(fNode); ASSERT(fNode);

12
Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp

@ -70,8 +70,8 @@ pyVaultPlayerInfoNode::pyVaultPlayerInfoNode()
} }
pyVaultPlayerInfoNode::~pyVaultPlayerInfoNode () { pyVaultPlayerInfoNode::~pyVaultPlayerInfoNode () {
FREE(ansiPlayerName); free(ansiPlayerName);
FREE(ansiAgeInstName); free(ansiAgeInstName);
} }
//================================================================== //==================================================================
@ -103,7 +103,7 @@ void pyVaultPlayerInfoNode::Player_SetPlayerName( const char * name )
wchar_t * wStr = StrDupToUnicode(name); wchar_t * wStr = StrDupToUnicode(name);
VaultPlayerInfoNode playerInfo(fNode); VaultPlayerInfoNode playerInfo(fNode);
playerInfo.SetPlayerName(wStr); playerInfo.SetPlayerName(wStr);
FREE(wStr); free(wStr);
} }
const char * pyVaultPlayerInfoNode::Player_GetPlayerName( void ) const char * pyVaultPlayerInfoNode::Player_GetPlayerName( void )
@ -115,7 +115,7 @@ const char * pyVaultPlayerInfoNode::Player_GetPlayerName( void )
if (!playerInfo.playerName) if (!playerInfo.playerName)
return ""; return "";
FREE(ansiPlayerName); free(ansiPlayerName);
ansiPlayerName = StrDupToAnsi(playerInfo.playerName); ansiPlayerName = StrDupToAnsi(playerInfo.playerName);
return ansiPlayerName; return ansiPlayerName;
} }
@ -129,7 +129,7 @@ void pyVaultPlayerInfoNode::Player_SetAgeInstanceName( const char * agename )
wchar_t * wStr = StrDupToUnicode(agename); wchar_t * wStr = StrDupToUnicode(agename);
VaultPlayerInfoNode playerInfo(fNode); VaultPlayerInfoNode playerInfo(fNode);
playerInfo.SetAgeInstName(wStr); playerInfo.SetAgeInstName(wStr);
FREE(wStr); free(wStr);
} }
const char * pyVaultPlayerInfoNode::Player_GetAgeInstanceName( void ) const char * pyVaultPlayerInfoNode::Player_GetAgeInstanceName( void )
@ -141,7 +141,7 @@ const char * pyVaultPlayerInfoNode::Player_GetAgeInstanceName( void )
if (!playerInfo.ageInstName) if (!playerInfo.ageInstName)
return ""; return "";
FREE(ansiAgeInstName); free(ansiAgeInstName);
ansiAgeInstName = StrDupToAnsi(playerInfo.ageInstName); ansiAgeInstName = StrDupToAnsi(playerInfo.ageInstName);
return ansiAgeInstName; return ansiAgeInstName;
} }

4
Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp

@ -189,7 +189,7 @@ PyObject *pyVaultPlayerNode::GetLinkToMyNeighborhood()
return result; return result;
} }
DEL(link); delete link;
PYTHON_RETURN_NONE; PYTHON_RETURN_NONE;
} }
@ -202,7 +202,7 @@ PyObject *pyVaultPlayerNode::GetLinkToCity()
return result; return result;
} }
DEL(link); delete link;
PYTHON_RETURN_NONE; PYTHON_RETURN_NONE;
} }

2
Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.cpp

@ -97,7 +97,7 @@ PyObject * pyVaultSDLNode::GetStateDataRecord() const
if (sdl.GetStateDataRecord(rec)) if (sdl.GetStateDataRecord(rec))
return pySDLStateDataRecord::New(rec); return pySDLStateDataRecord::New(rec);
else else
DEL(rec); delete rec;
PYTHON_RETURN_NONE; PYTHON_RETURN_NONE;
} }

6
Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.cpp

@ -103,7 +103,7 @@ std::string pyVaultTextNoteNode::Note_GetTitle( void )
std::string result; std::string result;
aStr = StrDupToAnsi(textNote.noteTitle); aStr = StrDupToAnsi(textNote.noteTitle);
result = aStr; result = aStr;
FREE(aStr); free(aStr);
return result; return result;
} }
return ""; return "";
@ -130,7 +130,7 @@ void pyVaultTextNoteNode::Note_SetText( const char * text )
wStr = StrDupToUnicode(text); wStr = StrDupToUnicode(text);
VaultTextNoteNode textNote(fNode); VaultTextNoteNode textNote(fNode);
textNote.SetNoteText(wStr); textNote.SetNoteText(wStr);
FREE(wStr); free(wStr);
} }
void pyVaultTextNoteNode::Note_SetTextW( const wchar_t * text ) void pyVaultTextNoteNode::Note_SetTextW( const wchar_t * text )
@ -153,7 +153,7 @@ std::string pyVaultTextNoteNode::Note_GetText( void )
std::string result; std::string result;
aStr = StrDupToAnsi(textNote.noteText); aStr = StrDupToAnsi(textNote.noteText);
result = aStr; result = aStr;
FREE(aStr); free(aStr);
return result; return result;
} }
return ""; return "";

2
Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNt.cpp

@ -102,7 +102,7 @@ void CNtWaitHandle::IncRef () {
//=========================================================================== //===========================================================================
void CNtWaitHandle::DecRef () { void CNtWaitHandle::DecRef () {
if (!InterlockedDecrement(&m_refCount)) if (!InterlockedDecrement(&m_refCount))
DEL(this); delete this;
} }
//=========================================================================== //===========================================================================

2
Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtFile.cpp

@ -384,7 +384,7 @@ void INtFileDelete (
} }
file->critsect.Leave(); file->critsect.Leave();
DEL(file); delete file;
} }
//=========================================================================== //===========================================================================

6
Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtSocket.cpp

@ -600,7 +600,7 @@ static void ListenPrepareListeners (fd_set * readfds) {
// destroy unused ports // destroy unused ports
if (!port->listenCount) { if (!port->listenCount) {
DEL(port); delete port;
continue; continue;
} }
@ -980,7 +980,7 @@ void INtSocketOpCompleteSocketConnect (NtOpConnAttempt * op) {
// and because connection attempts are not waitable // and because connection attempts are not waitable
ASSERT(!op->link.IsLinked()); ASSERT(!op->link.IsLinked());
ASSERT(!op->signalComplete); ASSERT(!op->signalComplete);
DEL(op); delete op;
PerfSubCounter(kAsyncPerfSocketConnAttemptsOutCurr, 1); PerfSubCounter(kAsyncPerfSocketConnAttemptsOutCurr, 1);
} }
@ -1259,7 +1259,7 @@ void NtSocketDelete (AsyncSocket conn) {
return; return;
} }
DEL(sock); delete sock;
} }
//=========================================================================== //===========================================================================

2
Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xFile.cpp

@ -190,7 +190,7 @@ void CFile::Complete (void * op, CCritSect * critSect, AsyncId asyncId) {
//=========================================================================== //===========================================================================
void CFile::Delete (void * op) { void CFile::Delete (void * op) {
FileOp * fileOp = (FileOp *)op; FileOp * fileOp = (FileOp *)op;
DEL(fileOp); delete fileOp;
} }
//=========================================================================== //===========================================================================

8
Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xSocket.cpp

@ -457,13 +457,13 @@ void CSocket::OnConnect () {
); );
// Delete the connect command // Delete the connect command
DEL(command); delete command;
// Handle failure to connect // Handle failure to connect
if (error) { if (error) {
// Destroy the socket // Destroy the socket
DEL(this); delete this;
} }
@ -643,7 +643,7 @@ void CSocket::ProcessQueue () {
} }
// Delete the command // Delete the command
DEL(command); delete command;
} }
@ -1105,7 +1105,7 @@ void W9xSocketDelete (
// Delete the object // Delete the object
s_critSect.Enter(); s_critSect.Enter();
DEL(object); delete object;
s_critSect.Leave(); s_critSect.Leave();
} }

2
Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xThread.cpp

@ -234,7 +234,7 @@ static unsigned CALLBACK W9xThreadProc (AsyncThread *) {
if (rec) { if (rec) {
s_dispInProcList.Link(rec); s_dispInProcList.Link(rec);
rec->Complete(&s_critSect); rec->Complete(&s_critSect);
DEL(rec); delete rec;
timeout = 0; timeout = 0;
} }
else { else {

2
Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Dns.cpp

@ -132,7 +132,7 @@ static void LookupProcess (Lookup * lookup, unsigned error) {
// section because it isn't linked into an ioConn opList // section because it isn't linked into an ioConn opList
// and because connection attempts are not waitable // and because connection attempts are not waitable
ASSERT(!lookup->link.IsLinked()); ASSERT(!lookup->link.IsLinked());
DEL(lookup); delete lookup;
PerfSubCounter(kAsyncPerfNameLookupAttemptsCurr, 1); PerfSubCounter(kAsyncPerfNameLookupAttemptsCurr, 1);
} }

2
Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Thread.cpp

@ -148,7 +148,7 @@ static unsigned THREADCALL ThreadTaskProc (AsyncThread * thread) {
#endif #endif
task->taskList->DecRef("task"); task->taskList->DecRef("task");
DEL(task); delete task;
} }
} }
PerfSubCounter(kAsyncPerfThreadTaskThreadsActive, 1); PerfSubCounter(kAsyncPerfThreadTaskThreadsActive, 1);

2
Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceIo.cpp

@ -553,7 +553,7 @@ void AsyncSocketUnregisterNotifyProc (
s_notifyProcLock.LeaveWrite(); s_notifyProcLock.LeaveWrite();
// perform memory deallocation outside the lock // perform memory deallocation outside the lock
DEL(scan); delete scan;
} }
//=========================================================================== //===========================================================================

6
Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceLog.cpp

@ -145,7 +145,7 @@ static void LogFileNotifyProc (
) { ) {
switch (code) { switch (code) {
case kNotifyFileWrite: case kNotifyFileWrite:
FREE(notify->param); free(notify->param);
AtomicAdd(&s_opsPending, -1); AtomicAdd(&s_opsPending, -1);
break; break;
@ -171,7 +171,7 @@ static void AllocLogBuffer_CS (unsigned index) {
//============================================================================ //============================================================================
static void FreeLogBuffer_CS (unsigned index) { static void FreeLogBuffer_CS (unsigned index) {
if (s_logBuf[index]) { if (s_logBuf[index]) {
FREE(s_logBuf[index]); free(s_logBuf[index]);
s_logBuf[index] = nil; s_logBuf[index] = nil;
} }
} }
@ -279,7 +279,7 @@ static void WriteLogFile_CS (unsigned index, bool close) {
s_logBuf[index] s_logBuf[index]
); );
if (flags == kAsyncFileRwSync) if (flags == kAsyncFileRwSync)
DEL(s_logBuf[index]); delete s_logBuf[index];
else else
AtomicAdd(&s_opsPending, 1); AtomicAdd(&s_opsPending, 1);
s_logWritePos[index] += s_logPos[index]; s_logWritePos[index] += s_logPos[index];

2
Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceThread.cpp

@ -75,7 +75,7 @@ static unsigned CALLBACK CreateThreadProc (LPVOID param) {
unsigned result = thread->proc(thread); unsigned result = thread->proc(thread);
// Cleanup thread // Cleanup thread
DEL(thread); delete thread;
PerfSubCounter(kAsyncPerfThreadsCurr, 1); PerfSubCounter(kAsyncPerfThreadsCurr, 1);
return result; return result;

4
Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceTimer.cpp

@ -133,7 +133,7 @@ static inline unsigned RunTimers () {
while (AsyncTimer * t = s_timerDelete.Head()) { while (AsyncTimer * t = s_timerDelete.Head()) {
if (t->destroyProc) if (t->destroyProc)
CallTimerProc(t, t->destroyProc); CallTimerProc(t, t->destroyProc);
DEL(t); delete t;
} }
// Get first timer to run // Get first timer to run
@ -225,7 +225,7 @@ void TimerDestroy (unsigned exitThreadWaitMs) {
while (AsyncTimer * t = s_timerDelete.Head()) { while (AsyncTimer * t = s_timerDelete.Head()) {
if (t->destroyProc) if (t->destroyProc)
CallTimerProc(t, t->destroyProc); CallTimerProc(t, t->destroyProc);
DEL(t); delete t;
} }
s_timerCrit.Leave(); s_timerCrit.Leave();

16
Sources/Plasma/NucleusLib/pnCrashExe/Win32/pnCreError.cpp

@ -65,7 +65,7 @@ struct Module {
wchar_t * name; wchar_t * name;
wchar_t * buildString; wchar_t * buildString;
~Module () { FREE(name); FREE(buildString); } ~Module () { free(name); free(buildString); }
}; };
struct EmailParams : AtomicRef { struct EmailParams : AtomicRef {
@ -77,12 +77,12 @@ struct EmailParams : AtomicRef {
char * replyTo; char * replyTo;
~EmailParams () { ~EmailParams () {
FREE(smtp); free(smtp);
FREE(sender); free(sender);
FREE(recipients); free(recipients);
FREE(username); free(username);
FREE(password); free(password);
FREE(replyTo); free(replyTo);
} }
}; };
@ -975,7 +975,7 @@ void CrashRemoveModule (
Module * module = (Module *) param; Module * module = (Module *) param;
SAFE_CRITSECT_ENTER(); SAFE_CRITSECT_ENTER();
{ {
DEL(module); delete module;
} }
SAFE_CRITSECT_LEAVE(); SAFE_CRITSECT_LEAVE();
} }

10
Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.cpp

@ -90,7 +90,7 @@ IniValue::~IniValue () {
wchar_t ** cur = fArgs.Ptr(); wchar_t ** cur = fArgs.Ptr();
wchar_t ** end = fArgs.Term(); wchar_t ** end = fArgs.Term();
for (; cur < end; ++cur) for (; cur < end; ++cur)
FREE(*cur); free(*cur);
} }
//=========================================================================== //===========================================================================
@ -124,7 +124,7 @@ IniKey::~IniKey () {
IniValue ** cur = fValues.Ptr(); IniValue ** cur = fValues.Ptr();
IniValue ** end = fValues.Term(); IniValue ** end = fValues.Term();
for (; cur < end; ++cur) for (; cur < end; ++cur)
DEL(*cur); delete *cur;
} }
//=========================================================================== //===========================================================================
@ -430,12 +430,12 @@ static bool ParseFile (
} }
} }
FREE(src); free(src);
buffer = (uint8_t *) dst; buffer = (uint8_t *) dst;
} }
ParseBuffer(ini, (const wchar_t *) buffer); ParseBuffer(ini, (const wchar_t *) buffer);
FREE(buffer); free(buffer);
result = true; result = true;
} }
@ -464,7 +464,7 @@ Ini * IniOpen (
//=========================================================================== //===========================================================================
void IniClose (Ini * ini) { void IniClose (Ini * ini) {
DEL(ini); delete ini;
} }
//=========================================================================== //===========================================================================

2
Sources/Plasma/NucleusLib/pnIniExe/Private/Win32/pnW32IniChange.cpp

@ -366,7 +366,7 @@ void IniChangeRemove (
s_lock.LeaveWrite(); s_lock.LeaveWrite();
// Delete object outside critical section // Delete object outside critical section
DEL(change); delete change;
} }
//=========================================================================== //===========================================================================

2
Sources/Plasma/NucleusLib/pnIniExe/Private/pnIniSrv.cpp

@ -114,7 +114,7 @@ static void IAddAddressBlock(ADDRESS_BLOCK_TABLE & addrList, NetAddressNode star
if ( (addrBlock->startAddress & CLASS_C_SUBNET_MASK) != (addrBlock->endAddress & CLASS_C_SUBNET_MASK) ) { if ( (addrBlock->startAddress & CLASS_C_SUBNET_MASK) != (addrBlock->endAddress & CLASS_C_SUBNET_MASK) ) {
LogMsg(kLogDebug, L"IniSrv: Error creating privileged address block - start address and end address aren't from the same subnet."); LogMsg(kLogDebug, L"IniSrv: Error creating privileged address block - start address and end address aren't from the same subnet.");
DEL(addrBlock); delete addrBlock;
} }
else { else {
addrBlock->SetValue(startAddr & CLASS_C_SUBNET_MASK); addrBlock->SetValue(startAddr & CLASS_C_SUBNET_MASK);

6
Sources/Plasma/NucleusLib/pnMail/pnMail.cpp

@ -353,7 +353,7 @@ static void DestroyTransaction (MailTransaction * transaction) {
); );
} }
DEL(transaction); delete transaction;
} }
//=========================================================================== //===========================================================================
@ -448,7 +448,7 @@ static void __cdecl Send (
char * packed; char * packed;
const unsigned kStackBufSize = 8 * 1024; const unsigned kStackBufSize = 8 * 1024;
if (bytes > kStackBufSize) if (bytes > kStackBufSize)
packed = (char *) ALLOC(bytes); packed = (char *) malloc(bytes);
else else
packed = (char *) _alloca(bytes); packed = (char *) _alloca(bytes);
@ -467,7 +467,7 @@ static void __cdecl Send (
// Free the string // Free the string
if (bytes > kStackBufSize) if (bytes > kStackBufSize)
FREE(packed); free(packed);
} }
//=========================================================================== //===========================================================================

2
Sources/Plasma/NucleusLib/pnNetCli/pnNcChannel.cpp

@ -110,7 +110,7 @@ ChannelCrit::~ChannelCrit () {
channel->DecRef("ChannelLink"); channel->DecRef("ChannelLink");
} }
DEL(s_channels); delete s_channels;
s_channels = nil; s_channels = nil;
} }
LeaveSafe(); LeaveSafe();

14
Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp

@ -195,7 +195,7 @@ static void PutBufferOnWire (NetCli * cli, void * data, unsigned bytes) {
temp = ALLOCA(uint8_t, bytes); temp = ALLOCA(uint8_t, bytes);
else else
// uint8_t count is large, use heap-based buffer // uint8_t count is large, use heap-based buffer
temp = heap = (uint8_t *)ALLOC(bytes); temp = heap = (uint8_t *)malloc(bytes);
MemCopy(temp, data, bytes); MemCopy(temp, data, bytes);
CryptEncrypt(cli->cryptOut, bytes, temp); CryptEncrypt(cli->cryptOut, bytes, temp);
@ -205,7 +205,7 @@ static void PutBufferOnWire (NetCli * cli, void * data, unsigned bytes) {
AsyncSocketSend(cli->sock, data, bytes); AsyncSocketSend(cli->sock, data, bytes);
// free heap buffer (if any) // free heap buffer (if any)
FREE(heap); free(heap);
} }
//============================================================================ //============================================================================
@ -227,10 +227,10 @@ static void AddToSendBuffer (
if (bytes > arrsize(cli->sendBuffer)) { if (bytes > arrsize(cli->sendBuffer)) {
// Let the OS fragment oversize buffers // Let the OS fragment oversize buffers
FlushSendBuffer(cli); FlushSendBuffer(cli);
void * heap = ALLOC(bytes); void * heap = malloc(bytes);
MemCopy(heap, data, bytes); MemCopy(heap, data, bytes);
PutBufferOnWire(cli, heap, bytes); PutBufferOnWire(cli, heap, bytes);
FREE(heap); free(heap);
} }
else { else {
for (;;) { for (;;) {
@ -1079,7 +1079,7 @@ void NetCliDelete (
cli->input.Clear(); cli->input.Clear();
cli->recvBuffer.Clear(); cli->recvBuffer.Clear();
DEL(cli); delete cli;
} }
//============================================================================ //============================================================================
@ -1120,7 +1120,7 @@ bool NetCliDispatch (
temp = ALLOCA(uint8_t, bytes); temp = ALLOCA(uint8_t, bytes);
else else
// uint8_t count is large, use heap-based buffer // uint8_t count is large, use heap-based buffer
temp = heap = (uint8_t *)ALLOC(bytes); temp = heap = (uint8_t *)malloc(bytes);
MemCopy(temp, data, bytes); MemCopy(temp, data, bytes);
CryptDecrypt(cli->cryptIn, bytes, temp); CryptDecrypt(cli->cryptIn, bytes, temp);
@ -1153,7 +1153,7 @@ bool NetCliDispatch (
#endif #endif
// free heap buffer (if any) // free heap buffer (if any)
FREE(heap); free(heap);
cli->input.Compact(); cli->input.Compact();
return cli->recvDispatch; return cli->recvDispatch;

4
Sources/Plasma/NucleusLib/pnNetDiag/pnNdDns.cpp

@ -113,7 +113,7 @@ static void LookupCallback (
); );
} }
p->diag->DecRef("DNS"); p->diag->DecRef("DNS");
DEL(p); delete p;
} }
@ -190,5 +190,5 @@ void NetDiagDns (
0, 0,
dnsParam dnsParam
); );
FREE(host); free(host);
} }

2
Sources/Plasma/NucleusLib/pnNetDiag/pnNdIcmp.cpp

@ -173,7 +173,7 @@ static void __cdecl PingThreadProc (void * param) {
p->callback(p->diag, p->protocol, result, p->param); p->callback(p->diag, p->protocol, result, p->param);
p->diag->DecRef("ICMP"); p->diag->DecRef("ICMP");
DEL(p); delete p;
} }

16
Sources/Plasma/NucleusLib/pnNetDiag/pnNdTcp.cpp

@ -167,7 +167,7 @@ static bool Recv_PingReply (
if (trans) { if (trans) {
unsigned replyAtMs = TimeGetMs(); unsigned replyAtMs = TimeGetMs();
trans->conn->dump(L"[TCP] Reply from SrvAuth. ms=%u", replyAtMs - trans->pingAtMs); trans->conn->dump(L"[TCP] Reply from SrvAuth. ms=%u", replyAtMs - trans->pingAtMs);
DEL(trans); delete trans;
return true; return true;
} }
else { else {
@ -209,7 +209,7 @@ static unsigned TimerCallback (void *) {
if (!curr->conn->error) if (!curr->conn->error)
curr->conn->error = error; curr->conn->error = error;
curr->conn->dump(L"[TCP] No reply from SrvAuth: %u, %s (ms=%u)", error, NetErrorToString(error), diff); curr->conn->dump(L"[TCP] No reply from SrvAuth: %u, %s (ms=%u)", error, NetErrorToString(error), diff);
DEL(curr); delete curr;
} }
}} }}
{for (FileTrans * next, * curr = s_fileTrans.Head(); curr; curr = next) { {for (FileTrans * next, * curr = s_fileTrans.Head(); curr; curr = next) {
@ -219,7 +219,7 @@ static unsigned TimerCallback (void *) {
if (!curr->conn->error) if (!curr->conn->error)
curr->conn->error = error; curr->conn->error = error;
curr->conn->dump(L"[TCP] No reply from SrvFile: %u, %s (ms=%u)", error, NetErrorToString(error), diff); curr->conn->dump(L"[TCP] No reply from SrvFile: %u, %s (ms=%u)", error, NetErrorToString(error), diff);
DEL(curr); delete curr;
} }
}} }}
} }
@ -244,7 +244,7 @@ static void AuthPingProc (void * param) {
for (;;) { for (;;) {
if (conn->done) { if (conn->done) {
conn->pingsCompleted = kMaxPings; conn->pingsCompleted = kMaxPings;
DEL(trans); delete trans;
break; break;
} }
while (++s_transId == 0) while (++s_transId == 0)
@ -352,7 +352,7 @@ static void NotifyAuthConnSocketDisconnect (AuthConn * conn) {
while (AuthTrans * trans = authTrans.Head()) { while (AuthTrans * trans = authTrans.Head()) {
conn->dump(L"[TCP] No reply from SrvAuth: %u, %s", conn->error, NetErrorToString(conn->error)); conn->dump(L"[TCP] No reply from SrvAuth: %u, %s", conn->error, NetErrorToString(conn->error));
DEL(trans); delete trans;
} }
conn->DecRef("Connected"); conn->DecRef("Connected");
@ -419,7 +419,7 @@ static bool Recv_File2Cli_ManifestReply (FileConn * conn, const File2Cli_Manifes
if (trans) { if (trans) {
unsigned replyAtMs = TimeGetMs(); unsigned replyAtMs = TimeGetMs();
trans->conn->dump(L"[TCP] Reply from SrvFile. ms=%u", replyAtMs - trans->pingAtMs); trans->conn->dump(L"[TCP] Reply from SrvFile. ms=%u", replyAtMs - trans->pingAtMs);
DEL(trans); delete trans;
return true; return true;
} }
else { else {
@ -443,7 +443,7 @@ static void FilePingProc (void * param) {
for (;;) { for (;;) {
if (conn->done) { if (conn->done) {
conn->pingsCompleted = kMaxPings; conn->pingsCompleted = kMaxPings;
DEL(trans); delete trans;
break; break;
} }
while (++s_transId == 0) while (++s_transId == 0)
@ -523,7 +523,7 @@ static void NotifyFileConnSocketDisconnect (FileConn * conn) {
while (FileTrans * trans = fileTrans.Head()) { while (FileTrans * trans = fileTrans.Head()) {
conn->dump(L"[TCP] No reply from SrvFile: %u, %s", conn->error, NetErrorToString(conn->error)); conn->dump(L"[TCP] No reply from SrvFile: %u, %s", conn->error, NetErrorToString(conn->error));
DEL(trans); delete trans;
} }
conn->DecRef("Connected"); conn->DecRef("Connected");

4
Sources/Plasma/NucleusLib/pnNetDiag/pnNetDiag.cpp

@ -82,7 +82,7 @@ const wchar_t g_version[] = L"solvent";
NetDiag::~NetDiag () { NetDiag::~NetDiag () {
for (unsigned srv = 0; srv < kNumDiagSrvs; ++srv) for (unsigned srv = 0; srv < kNumDiagSrvs; ++srv)
FREE(hosts[srv]); free(hosts[srv]);
} }
//============================================================================ //============================================================================
@ -90,7 +90,7 @@ void NetDiag::SetHost (unsigned srv, const wchar_t host[]) {
critsect.Enter(); critsect.Enter();
{ {
FREE(hosts[srv]); free(hosts[srv]);
if (host) if (host)
hosts[srv] = StrDup(host); hosts[srv] = StrDup(host);

2
Sources/Plasma/NucleusLib/pnNetDiag/pnNetSys.cpp

@ -172,6 +172,6 @@ void NetDiagSys (
dump(L"[SYS] Error getting adaper list"); dump(L"[SYS] Error getting adaper list");
callback(diag, kNetProtocolNil, kNetErrFileNotFound, param); callback(diag, kNetProtocolNil, kNetErrFileNotFound, param);
} }
FREE(pInfo); free(pInfo);
} }
} }

2
Sources/Plasma/NucleusLib/pnNetLog/pnNlCli.cpp

@ -416,7 +416,7 @@ bool LogMsgTrans::OnTransReply (
AddEventNode(msgBuffer); AddEventNode(msgBuffer);
} }
else { else {
FREE(msgBuffer); free(msgBuffer);
} }
return true; return true;
} }

12
Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp

@ -89,7 +89,7 @@ static inline void IReadArray (T ** buf, unsigned * elems, uint8_t ** buffer, un
ASSERT(bytes % sizeof(T) == 0); ASSERT(bytes % sizeof(T) == 0);
*elems = bytes / sizeof(T); *elems = bytes / sizeof(T);
T * src = (T *)*buffer; T * src = (T *)*buffer;
DEL(*buf); delete *buf;
*buf = (T *)ALLOC(bytes); *buf = (T *)ALLOC(bytes);
MemCopy(*buf, src, bytes); MemCopy(*buf, src, bytes);
*buffer += bytes; *buffer += bytes;
@ -168,7 +168,7 @@ static inline void ICopyValue (T * plhs, const T & rhs) {
//============================================================================ //============================================================================
template <typename T> template <typename T>
static inline void ICopyString (T ** plhs, const T rhs[]) { static inline void ICopyString (T ** plhs, const T rhs[]) {
FREE(*plhs); free(*plhs);
if (rhs) if (rhs)
*plhs = StrDup(rhs); *plhs = StrDup(rhs);
else else
@ -177,7 +177,7 @@ static inline void ICopyString (T ** plhs, const T rhs[]) {
//============================================================================ //============================================================================
static inline void ICopyString (wchar_t ** plhs, const wchar_t rhs[]) { static inline void ICopyString (wchar_t ** plhs, const wchar_t rhs[]) {
FREE(*plhs); free(*plhs);
if (rhs) if (rhs)
*plhs = StrDup(rhs); *plhs = StrDup(rhs);
else else
@ -250,7 +250,7 @@ unsigned NetGameScore::Read(const uint8_t inbuffer[], unsigned bufsz, uint8_t**
IReadString(&tempstr, &buffer, &bufsz); IReadString(&tempstr, &buffer, &bufsz);
StrCopy(gameName, tempstr, arrsize(gameName)); StrCopy(gameName, tempstr, arrsize(gameName));
DEL(tempstr); delete tempstr;
if (end) if (end)
*end = buffer; *end = buffer;
@ -302,7 +302,7 @@ unsigned NetGameRank::Read(const uint8_t inbuffer[], unsigned bufsz, uint8_t** e
IReadString(&tempstr, &buffer, &bufsz); IReadString(&tempstr, &buffer, &bufsz);
StrCopy(name, tempstr, arrsize(name)); StrCopy(name, tempstr, arrsize(name));
DEL(tempstr); delete tempstr;
if (end) if (end)
*end = buffer; *end = buffer;
@ -341,7 +341,7 @@ static void DeallocNodeFields (NetVaultNode * node) {
if (fieldFlag > node->fieldFlags) if (fieldFlag > node->fieldFlags)
break; break;
#define DELFIELD(f, v) case (uint64_t)(NetVaultNode::f): DEL(node->v); node->v = nil; break #define DELFIELD(f, v) case (uint64_t)(NetVaultNode::f): delete node->v; node->v = nil; break
switch (fieldFlag & node->fieldFlags) { switch (fieldFlag & node->fieldFlags) {
DELFIELD(kCreateAgeName, createAgeName); DELFIELD(kCreateAgeName, createAgeName);
DELFIELD(kString64_1, string64_1); DELFIELD(kString64_1, string64_1);

8
Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h

@ -334,7 +334,7 @@ inline void IVaultNodeSetString (
const char src[], const char src[],
unsigned chars unsigned chars
) { ) {
FREE(*pdst); free(*pdst);
if (src && src[0]) if (src && src[0])
*pdst = StrDupLen(src, chars); *pdst = StrDupLen(src, chars);
else else
@ -351,7 +351,7 @@ inline void IVaultNodeSetString (
const wchar_t src[], const wchar_t src[],
unsigned chars unsigned chars
) { ) {
FREE(*pdst); free(*pdst);
if (src && src[0]) if (src && src[0])
*pdst = StrDupLen(src, chars); *pdst = StrDupLen(src, chars);
else else
@ -382,7 +382,7 @@ inline void IVaultNodeSetBlob (
const uint8_t src[], const uint8_t src[],
unsigned srcLen unsigned srcLen
) { ) {
FREE(*pdst); free(*pdst);
if (src) { if (src) {
*pdst = (uint8_t*)MEMDUP(src, srcLen); *pdst = (uint8_t*)MEMDUP(src, srcLen);
*pdstLen = srcLen; *pdstLen = srcLen;
@ -495,4 +495,4 @@ public:
private: private:
const uint8_t * m_pos; const uint8_t * m_pos;
const uint8_t * m_end; const uint8_t * m_end;
}; };

6
Sources/Plasma/NucleusLib/pnOraLib/pnOraLib.cpp

@ -260,7 +260,7 @@ void OraConnPool::Shutdown () {
} }
critsect.Leave(); critsect.Leave();
DEL(data); delete data;
} }
//============================================================================ //============================================================================
@ -298,7 +298,7 @@ OraConn * OraConnPool::GetConn (const wchar_t tag[]) {
for (;;) { for (;;) {
if (!oraConn || !oraConn->occiConn) { if (!oraConn || !oraConn->occiConn) {
DEL(oraConn); delete oraConn;
oraConn = nil; oraConn = nil;
LogMsg(kLogError, L"OraConnPool::GetConn: Failed to aquire a database connection"); LogMsg(kLogError, L"OraConnPool::GetConn: Failed to aquire a database connection");
break; break;
@ -331,7 +331,7 @@ void OraConnPool::FreeConn (OraConn *& oraConn) {
LogMsg(kLogPerf, L"OraFreeConn: %u, %p, %s", connCount, oraConn, oraConn->tag); LogMsg(kLogPerf, L"OraFreeConn: %u, %p, %s", connCount, oraConn, oraConn->tag);
#endif #endif
DEL(oraConn); delete oraConn;
try { try {
occiConn->commit(); occiConn->commit();

10
Sources/Plasma/NucleusLib/pnSimpleNet/pnSimpleNet.cpp

@ -135,7 +135,7 @@ static void NotifyConnSocketConnect (SimpleNetConn * conn) {
kNetSuccess kNetSuccess
); );
DEL(conn->connectParam); delete conn->connectParam;
conn->connectParam = nil; conn->connectParam = nil;
} }
@ -154,7 +154,7 @@ static void NotifyConnSocketConnectFailed (SimpleNetConn * conn) {
kNetErrConnectFailed kNetErrConnectFailed
); );
DEL(conn->connectParam); delete conn->connectParam;
conn->connectParam = nil; conn->connectParam = nil;
conn->DecRef("Connecting"); conn->DecRef("Connecting");
@ -401,8 +401,8 @@ static void Connect (const NetAddress & addr, ConnectParam * cp) {
} }
s_critsect.Leave(); s_critsect.Leave();
DEL(conn); delete conn;
DEL(cp); delete cp;
} }
//============================================================================ //============================================================================
@ -417,7 +417,7 @@ static void AsyncLookupCallback (
if (!addrCount) { if (!addrCount) {
if (cp->callback) if (cp->callback)
cp->callback(cp->param, nil, kNetErrNameLookupFailed); cp->callback(cp->param, nil, kNetErrNameLookupFailed);
DEL(cp); delete cp;
return; return;
} }

14
Sources/Plasma/NucleusLib/pnSqlLib/Private/pnSqlConn.cpp

@ -513,7 +513,7 @@ void SqlStmt::Reset () {
} }
#endif // ORACLE_FREE_DRIVER #endif // ORACLE_FREE_DRIVER
FREE(data); free(data);
data = nil; data = nil;
debug[0] = 0; debug[0] = 0;
} }
@ -562,7 +562,7 @@ SqlConn::SqlConn (
SqlConn::~SqlConn () { SqlConn::~SqlConn () {
ASSERT(!freeStmts.Head()); ASSERT(!freeStmts.Head());
ASSERT(!stmts.Head()); ASSERT(!stmts.Head());
DEL(connectStr); delete connectStr;
SQLFreeHandle(SQL_HANDLE_ENV, henv); SQLFreeHandle(SQL_HANDLE_ENV, henv);
AsyncThreadTaskListDestroy(taskList, kNetErrRemoteShutdown); AsyncThreadTaskListDestroy(taskList, kNetErrRemoteShutdown);
AtomicAdd(&s_perf[kSqlConnPerfConnDesired], - (long) desiredConns); AtomicAdd(&s_perf[kSqlConnPerfConnDesired], - (long) desiredConns);
@ -598,7 +598,7 @@ bool SqlConn::GrowConnections_CS (unsigned attempts) {
// If the connection failed then bail // If the connection failed then bail
if (!result) { if (!result) {
DEL(stmt); delete stmt;
return false; return false;
} }
@ -695,7 +695,7 @@ void SqlConn::CheckDead_CS () {
// Deallocate the statement if it's bogus // Deallocate the statement if it's bogus
if (dead) { if (dead) {
DEL(stmt); delete stmt;
AsyncGrowConnections_CS(); AsyncGrowConnections_CS();
} }
else { else {
@ -846,7 +846,7 @@ void SqlConnDestroy (SqlConn * conn) {
break; break;
} }
DEL(conn); delete conn;
} }
//============================================================================ //============================================================================
@ -873,11 +873,11 @@ void SqlConnFreeStmt (SqlStmt * stmt) {
conn->critsect.Enter(); conn->critsect.Enter();
{ {
if (stmt->flags & kStmtFlagDelete) { if (stmt->flags & kStmtFlagDelete) {
DEL(stmt); delete stmt;
conn->AsyncGrowConnections_CS(); conn->AsyncGrowConnections_CS();
} }
else if (dead) { else if (dead) {
DEL(stmt); delete stmt;
conn->AsyncCheckDead_CS(); conn->AsyncCheckDead_CS();
} }
else { else {

4
Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Sync.cpp

@ -166,7 +166,7 @@ CLockWaitSetAllocator::CLockWaitSetAllocator (CLockWaitSetAllocator * prev) {
//=========================================================================== //===========================================================================
CLockWaitSetAllocator::~CLockWaitSetAllocator () { CLockWaitSetAllocator::~CLockWaitSetAllocator () {
DEL(m_prev); delete m_prev;
} }
//=========================================================================== //===========================================================================
@ -207,7 +207,7 @@ void CLockWaitSetAllocator::Shutdown () {
// Free all allocators // Free all allocators
while (s_allocator) { while (s_allocator) {
CLockWaitSetAllocator * prev = s_allocator->m_prev; CLockWaitSetAllocator * prev = s_allocator->m_prev;
DEL(s_allocator); delete s_allocator;
s_allocator = prev; s_allocator = prev;
} }

8
Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.cpp

@ -78,7 +78,7 @@ struct CmdArgData {
~CmdArgData () { ~CmdArgData () {
if (buffer) if (buffer)
FREE(buffer); free(buffer);
} }
}; };
@ -218,7 +218,7 @@ void CICmdParser::Error (const CmdTokState * state, ECmdError errorCode, const w
state->parser->OnError(buffer, errorCode, arg, value); state->parser->OnError(buffer, errorCode, arg, value);
// Free memory // Free memory
FREE(buffer); free(buffer);
} }
@ -350,7 +350,7 @@ bool CICmdParser::ProcessValue (CmdTokState * state, unsigned index, const wchar
case kCmdTypeString: case kCmdTypeString:
if (arg.buffer) if (arg.buffer)
FREE(arg.buffer); free(arg.buffer);
arg.buffer = StrDup(str); arg.buffer = StrDup(str);
arg.val.strVal = arg.buffer; arg.val.strVal = arg.buffer;
break; break;
@ -539,7 +539,7 @@ CCmdParser::CCmdParser (const CmdArgDef def[], unsigned defCount) {
//=========================================================================== //===========================================================================
CCmdParser::~CCmdParser () { CCmdParser::~CCmdParser () {
DEL(fParser); delete fParser;
} }
//=========================================================================== //===========================================================================

4
Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp

@ -254,8 +254,8 @@ void CryptKeyClose (
if (!key) if (!key)
return; return;
DEL(key->handle); delete key->handle;
DEL(key); delete key;
} }
//============================================================================ //============================================================================

6
Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.h

@ -341,7 +341,7 @@ void TBaseHashTable<T>::Clear () {
//=========================================================================== //===========================================================================
template<class T> template<class T>
void TBaseHashTable<T>::Delete (T * object) { void TBaseHashTable<T>::Delete (T * object) {
DEL(object); delete object;
} }
//=========================================================================== //===========================================================================
@ -555,7 +555,7 @@ template<class T, class K>
T * THashTable<T,K>::Unduplicate (T * object, const K & key) { T * THashTable<T,K>::Unduplicate (T * object, const K & key) {
T * existing = Find(key); T * existing = Find(key);
if (existing) { if (existing) {
DEL(object); delete object;
return existing; return existing;
} }
else { else {
@ -730,7 +730,7 @@ public:
} }
void SetString (const C str[]) { // deprecated void SetString (const C str[]) { // deprecated
if (this->m_str) if (this->m_str)
FREE(const_cast<C *>(this->m_str)); free(const_cast<C *>(this->m_str));
if (str) if (str)
this->m_str = StrDup(str); this->m_str = StrDup(str);
else else

2
Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.h

@ -485,7 +485,7 @@ void TList<T>::Clear () {
//=========================================================================== //===========================================================================
template<class T> template<class T>
void TList<T>::Delete (T * node) { void TList<T>::Delete (T * node) {
DEL(node); delete node;
} }
//=========================================================================== //===========================================================================

4
Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPriQ.h

@ -143,7 +143,7 @@ inline void TPriorityQueue<C,P>::Clear () {
// Deleting an object could cause other objects in the queue to be deleted // Deleting an object could cause other objects in the queue to be deleted
// so we can't make any assumptions about indices or counts of items in the array // so we can't make any assumptions about indices or counts of items in the array
while (C * head = Dequeue()) while (C * head = Dequeue())
DEL(head); delete head;
m_array.Clear(); m_array.Clear();
} }
@ -164,7 +164,7 @@ C * TPriorityQueue<C,P>::Delete (C * object) {
unsigned index = priority->GetIndex(); unsigned index = priority->GetIndex();
// delete the object // delete the object
DEL(object); delete object;
// return the next object in that queue // return the next object in that queue
if (queue && (index < queue->Count())) if (queue && (index < queue->Count()))

2
Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRef.h

@ -168,7 +168,7 @@ public:
} }
inline virtual void OnZeroRef () { inline virtual void OnZeroRef () {
DEL(this); delete this;
} }
protected: protected:

6
Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSkipList.h

@ -175,7 +175,7 @@ typename TSkipList<T,K,keyOffset,Cmp>::Node* TSkipList<T,K,keyOffset,Cmp>::Alloc
template<class T, class K, unsigned keyOffset, class Cmp> template<class T, class K, unsigned keyOffset, class Cmp>
void TSkipList<T,K,keyOffset,Cmp>::FreeNode (TNode<T,K> * node) { void TSkipList<T,K,keyOffset,Cmp>::FreeNode (TNode<T,K> * node) {
FREE(node); free(node);
} }
//============================================================================ //============================================================================
@ -243,7 +243,7 @@ void TSkipList<T,K,keyOffset,Cmp>::Clear () {
Node * ptr = m_head->next[0]; Node * ptr = m_head->next[0];
while (ptr != m_stop) { while (ptr != m_stop) {
Node * next = ptr->next[0]; Node * next = ptr->next[0];
DEL(ptr->object); delete ptr->object;
FreeNode(ptr); FreeNode(ptr);
ptr = next; ptr = next;
} }
@ -259,7 +259,7 @@ template<class T, class K, unsigned keyOffset, class Cmp>
void TSkipList<T,K,keyOffset,Cmp>::Delete (T * object) { void TSkipList<T,K,keyOffset,Cmp>::Delete (T * object) {
Unlink(object); Unlink(object);
DEL(object); delete object;
} }
//============================================================================ //============================================================================

2
Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.cpp

@ -159,7 +159,7 @@ void CBaseSpareList::CleanUp (const char typeName[]) {
// walk chain of AllocNodes and free each of them // walk chain of AllocNodes and free each of them
while (m_allocHead) { while (m_allocHead) {
AllocNode * allocNext = m_allocHead->allocNext; AllocNode * allocNext = m_allocHead->allocNext;
FREE(m_allocHead); free(m_allocHead);
m_allocHead = allocNext; m_allocHead = allocNext;
} }

4
Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h

@ -65,7 +65,7 @@ struct SubstParsedData {
} }
~SubstBlock() { ~SubstBlock() {
FREE(data); free(data);
} }
}; };
@ -74,7 +74,7 @@ struct SubstParsedData {
~SubstParsedData() { ~SubstParsedData() {
for (unsigned i = 0; i < blocks.Count(); ++i) { for (unsigned i = 0; i < blocks.Count(); ++i) {
SubstBlock<chartype> * block = blocks[i]; SubstBlock<chartype> * block = blocks[i];
DEL(block); delete block;
} }
} }
}; };

2
Sources/Plasma/PubUtilLib/plAudioCore/plBufferedFileReader.cpp

@ -115,7 +115,7 @@ void plBufferedFileReader::Close( void )
{ {
//plProfile_DelMem( SndBufferedMem, fBufferSize ); //plProfile_DelMem( SndBufferedMem, fBufferSize );
DEL(fBuffer);; delete fBuffer;
fBuffer = nil; fBuffer = nil;
fBufferSize = 0; fBufferSize = 0;
fCursor = 0; fCursor = 0;

6
Sources/Plasma/PubUtilLib/plAudioCore/plOGGCodec.cpp

@ -82,7 +82,7 @@ void plOGGCodec::BuildActualWaveHeader()
int factdata = 0; int factdata = 0;
int size = fDataSize+48; // size of data with header except for first four bytes int size = fDataSize+48; // size of data with header except for first four bytes
fHeadBuf = (uint8_t *) ALLOC(56); fHeadBuf = (uint8_t *)malloc(56);
memcpy(fHeadBuf, "RIFF", 4); memcpy(fHeadBuf, "RIFF", 4);
memcpy(fHeadBuf+4, &size, 4); memcpy(fHeadBuf+4, &size, 4);
memcpy(fHeadBuf+8, "WAVE", 4); memcpy(fHeadBuf+8, "WAVE", 4);
@ -189,12 +189,12 @@ plOGGCodec::~plOGGCodec()
void plOGGCodec::Close( void ) void plOGGCodec::Close( void )
{ {
// plNetClientApp::StaticDebugMsg("Ogg Close, t=%f, start", hsTimer::GetSeconds()); // plNetClientApp::StaticDebugMsg("Ogg Close, t=%f, start", hsTimer::GetSeconds());
FREE(fHeadBuf); free(fHeadBuf);
fHeadBuf = nil; fHeadBuf = nil;
if( fOggFile != nil ) if( fOggFile != nil )
{ {
ov_clear( fOggFile ); ov_clear( fOggFile );
DEL(fOggFile); delete fOggFile;
fOggFile = nil; fOggFile = nil;
} }

4
Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp

@ -973,7 +973,7 @@ void plClothingOutfit::WriteToVault(const ARRAY(plStateDataRecord*) & SDRs)
// Cleanup morph SDRs // Cleanup morph SDRs
{for (unsigned i = 0; i < morphs.Count(); ++i) { {for (unsigned i = 0; i < morphs.Count(); ++i) {
DEL(morphs[i]); delete morphs[i];
}} }}
rvn->DecRef(); rvn->DecRef();
@ -1614,7 +1614,7 @@ void plClothingMgr::GetClosetItems(hsTArray<plClosetItem> &out)
plStateDataRecord * rec = NEWZERO(plStateDataRecord); plStateDataRecord * rec = NEWZERO(plStateDataRecord);
if (sdl.GetStateDataRecord(rec, 0)) if (sdl.GetStateDataRecord(rec, 0))
plClothingSDLModifier::HandleSingleSDR(rec, nil, &out[i]); plClothingSDLModifier::HandleSingleSDR(rec, nil, &out[i]);
DEL(rec); delete rec;
} }
if (out.GetCount()) { if (out.GetCount()) {

8
Sources/Plasma/PubUtilLib/plCompression/plZlibStream.cpp

@ -44,12 +44,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
voidpf ZlibAlloc(voidpf opaque, uInt items, uInt size) voidpf ZlibAlloc(voidpf opaque, uInt items, uInt size)
{ {
return ALLOC(items*size); return malloc(items*size);
} }
void ZlibFree(voidpf opaque, voidpf address) void ZlibFree(voidpf opaque, voidpf address)
{ {
FREE(address); free(address);
} }
plZlibStream::plZlibStream() : fOutput(nil), fZStream(nil), fHeader(kNeedMoreData), fDecompressedOk(false) plZlibStream::plZlibStream() : fOutput(nil), fZStream(nil), fHeader(kNeedMoreData), fDecompressedOk(false)
@ -85,14 +85,14 @@ hsBool plZlibStream::Close()
if (fOutput) if (fOutput)
{ {
fOutput->Close(); fOutput->Close();
DEL(fOutput); delete fOutput;
fOutput = nil; fOutput = nil;
} }
if (fZStream) if (fZStream)
{ {
z_streamp zstream = (z_streamp)fZStream; z_streamp zstream = (z_streamp)fZStream;
inflateEnd(zstream); inflateEnd(zstream);
DEL(zstream); delete zstream;
fZStream = nil; fZStream = nil;
} }

4
Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp

@ -542,14 +542,14 @@ bool plFileUtils::GetSecureEncryptionKey(const wchar_t* filename, uint32_t* key,
file.Open(keyFile.c_str(), L"rb"); file.Open(keyFile.c_str(), L"rb");
unsigned bytesToRead = length * sizeof(uint32_t); unsigned bytesToRead = length * sizeof(uint32_t);
uint8_t* buffer = (uint8_t*)ALLOC(bytesToRead); uint8_t* buffer = (uint8_t*)malloc(bytesToRead);
unsigned bytesRead = file.Read(bytesToRead, buffer); unsigned bytesRead = file.Read(bytesToRead, buffer);
file.Close(); file.Close();
unsigned memSize = min(bytesToRead, bytesRead); unsigned memSize = min(bytesToRead, bytesRead);
memcpy(key, buffer, memSize); memcpy(key, buffer, memSize);
FREE(buffer); free(buffer);
return true; return true;
} }

4
Sources/Plasma/PubUtilLib/plMessage/plConsoleMsg.h

@ -70,7 +70,7 @@ public:
plMessage(nil, nil, nil), fCmd( cmd ), fString(hsStrcpy(str)) plMessage(nil, nil, nil), fCmd( cmd ), fString(hsStrcpy(str))
{ SetBCastFlag( kBCastByExactType ); } { SetBCastFlag( kBCastByExactType ); }
~plConsoleMsg() { FREE(fString); } ~plConsoleMsg() { free(fString); }
CLASSNAME_REGISTER( plConsoleMsg ); CLASSNAME_REGISTER( plConsoleMsg );
GETINTERFACE_ANY( plConsoleMsg, plMessage ); GETINTERFACE_ANY( plConsoleMsg, plMessage );
@ -79,7 +79,7 @@ public:
const char *GetString( void ) const { return fString; }; const char *GetString( void ) const { return fString; };
void SetCmd (uint32_t cmd) { fCmd = cmd; } void SetCmd (uint32_t cmd) { fCmd = cmd; }
void SetString (const char str[]) { FREE(fString); fString = hsStrcpy(str); } void SetString (const char str[]) { free(fString); fString = hsStrcpy(str); }
virtual void Read(hsStream* s, hsResMgr* mgr) virtual void Read(hsStream* s, hsResMgr* mgr)
{ {

2
Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp

@ -198,7 +198,7 @@ void plNCAgeJoiner::Complete (bool success, const char msg[]) {
notify.msg = msg; notify.msg = msg;
callback(this, kAgeJoinerComplete, &notify, userState); callback(this, kAgeJoinerComplete, &notify, userState);
DEL(this); delete this;
} }
} }

2
Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeLeaver.cpp

@ -139,7 +139,7 @@ void plNCAgeLeaver::Complete (bool success, const char msg[]) {
notify.msg = msg; notify.msg = msg;
callback(this, kAgeLeaveComplete, &notify, userState); callback(this, kAgeLeaveComplete, &notify, userState);
DEL(this); delete this;
} }
} }

4
Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp

@ -172,7 +172,7 @@ void plNetClientMgr::ISendCCRPetition(plCCRPetitionMsg* petMsg)
wchar_t * wStr = StrDupToUnicode(buf.c_str()); wchar_t * wStr = StrDupToUnicode(buf.c_str());
NetCliAuthSendCCRPetition(wStr); NetCliAuthSendCCRPetition(wStr);
FREE(wStr); free(wStr);
} }
// //
@ -470,5 +470,5 @@ void plNetClientMgr::StoreSDLState(const plStateDataRecord* sdRec, const plUoid&
} }
SendMsg(msg); SendMsg(msg);
DEL(msg); delete msg;
} }

8
Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp

@ -116,7 +116,7 @@ struct NlmLeaveAgeOp : NlmOp {
struct NlmOpNode { struct NlmOpNode {
LINK(NlmOpNode) link; LINK(NlmOpNode) link;
NlmOp * op; NlmOp * op;
~NlmOpNode () { DEL(op); } ~NlmOpNode () { delete op; }
}; };
@ -173,7 +173,7 @@ void plNetLinkingMgr::NCAgeJoinerCallback (
// Pull our wait op off exec queue // Pull our wait op off exec queue
if (NlmOpWaitOp * waitOp = (NlmOpWaitOp *) userState) if (NlmOpWaitOp * waitOp = (NlmOpWaitOp *) userState)
DEL(waitOp->node); delete waitOp->node;
} }
break; break;
@ -195,7 +195,7 @@ void plNetLinkingMgr::NCAgeLeaverCallback (
// Pull our wait op off exec queue // Pull our wait op off exec queue
if (NlmOpWaitOp * waitOp = (NlmOpWaitOp *) userState) if (NlmOpWaitOp * waitOp = (NlmOpWaitOp *) userState)
DEL(waitOp->node); delete waitOp->node;
} }
break; break;
@ -260,7 +260,7 @@ void plNetLinkingMgr::ExecNextOp () {
break; break;
} }
DEL(opNode); delete opNode;
} }

4
Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp

@ -551,7 +551,7 @@ static void INetCliAuthGetPublicAgeListCallback (
msg->ages.Set(ages.Ptr(), ages.Count()); msg->ages.Set(ages.Ptr(), ages.Count());
msg->Send(); msg->Send();
DEL(cp); delete cp;
} }
//============================================================================ //============================================================================
@ -1180,7 +1180,7 @@ void NetCommRemoveMsgHandler (
continue; continue;
// We found a matching handler, delete it // We found a matching handler, delete it
DEL(handler); delete handler;
} }
} }

14
Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp

@ -3634,7 +3634,7 @@ bool FileDownloadRequestTrans::Recv (
writeTrans->writer = m_writer; writeTrans->writer = m_writer;
writeTrans->bytes = reply.chunkSize; writeTrans->bytes = reply.chunkSize;
writeTrans->offset = reply.chunkOffset; writeTrans->offset = reply.chunkOffset;
writeTrans->data = (uint8_t *)ALLOC(reply.chunkSize); writeTrans->data = (uint8_t *)malloc(reply.chunkSize);
MemCopy(writeTrans->data, reply.chunkData, reply.chunkSize); MemCopy(writeTrans->data, reply.chunkData, reply.chunkSize);
NetTransSend(writeTrans); NetTransSend(writeTrans);
} }
@ -3664,7 +3664,7 @@ bool FileDownloadRequestTrans::Recv (
//============================================================================ //============================================================================
RcvdFileDownloadChunkTrans::~RcvdFileDownloadChunkTrans () { RcvdFileDownloadChunkTrans::~RcvdFileDownloadChunkTrans () {
FREE(data); free(data);
} }
//============================================================================ //============================================================================
@ -3687,7 +3687,7 @@ void RcvdFileDownloadChunkTrans::Post () {
//============================================================================ //============================================================================
RcvdPropagatedBufferTrans::~RcvdPropagatedBufferTrans () { RcvdPropagatedBufferTrans::~RcvdPropagatedBufferTrans () {
FREE(bufferData); free(bufferData);
} }
//============================================================================ //============================================================================
@ -3845,10 +3845,10 @@ VaultInitAgeTrans::VaultInitAgeTrans (
//============================================================================ //============================================================================
VaultInitAgeTrans::~VaultInitAgeTrans () { VaultInitAgeTrans::~VaultInitAgeTrans () {
FREE(m_ageFilename); free(m_ageFilename);
FREE(m_ageInstName); free(m_ageInstName);
FREE(m_ageUserName); free(m_ageUserName);
FREE(m_ageDesc); free(m_ageDesc);
} }
//============================================================================ //============================================================================

4
Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglCsr.cpp

@ -108,7 +108,7 @@ struct ConnectedNotifyTrans : NetNotifyTrans {
, m_latestBuildId(lbi) , m_latestBuildId(lbi)
{ } { }
~ConnectedNotifyTrans () { ~ConnectedNotifyTrans () {
DEL(m_connectParam); delete m_connectParam;
} }
void Post (); void Post ();
}; };
@ -543,7 +543,7 @@ CliCsConn::~CliCsConn () {
if (cli) if (cli)
NetCliDelete(cli, true); NetCliDelete(cli, true);
DEL(connectParam); delete connectParam;
AtomicAdd(&s_perf[kPerfConnCount], -1); AtomicAdd(&s_perf[kPerfConnCount], -1);
} }

4
Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp

@ -1195,7 +1195,7 @@ bool DownloadRequestTrans::Recv (
RcvdFileDownloadChunkTrans * writeTrans = NEW(RcvdFileDownloadChunkTrans); RcvdFileDownloadChunkTrans * writeTrans = NEW(RcvdFileDownloadChunkTrans);
writeTrans->writer = m_writer; writeTrans->writer = m_writer;
writeTrans->bytes = byteCount; writeTrans->bytes = byteCount;
writeTrans->data = (uint8_t *)ALLOC(byteCount); writeTrans->data = (uint8_t *)malloc(byteCount);
MemCopy(writeTrans->data, data, byteCount); MemCopy(writeTrans->data, data, byteCount);
NetTransSend(writeTrans); NetTransSend(writeTrans);
} }
@ -1217,7 +1217,7 @@ bool DownloadRequestTrans::Recv (
//============================================================================ //============================================================================
RcvdFileDownloadChunkTrans::~RcvdFileDownloadChunkTrans () { RcvdFileDownloadChunkTrans::~RcvdFileDownloadChunkTrans () {
FREE(data); free(data);
} }
//============================================================================ //============================================================================

8
Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp

@ -456,7 +456,7 @@ static bool Recv_PropagateBuffer (
RcvdPropagatedBufferTrans * trans = NEW(RcvdPropagatedBufferTrans); RcvdPropagatedBufferTrans * trans = NEW(RcvdPropagatedBufferTrans);
trans->bufferType = reply.type; trans->bufferType = reply.type;
trans->bufferBytes = reply.bytes; trans->bufferBytes = reply.bytes;
trans->bufferData = (uint8_t *)ALLOC(reply.bytes); trans->bufferData = (uint8_t *)malloc(reply.bytes);
MemCopy(trans->bufferData, reply.buffer, reply.bytes); MemCopy(trans->bufferData, reply.buffer, reply.bytes);
NetTransSend(trans); NetTransSend(trans);
@ -473,7 +473,7 @@ static bool Recv_GameMgrMsg (
RcvdGameMgrMsgTrans * trans = NEW(RcvdGameMgrMsgTrans); RcvdGameMgrMsgTrans * trans = NEW(RcvdGameMgrMsgTrans);
trans->bufferBytes = reply.bytes; trans->bufferBytes = reply.bytes;
trans->bufferData = (uint8_t *)ALLOC(reply.bytes); trans->bufferData = (uint8_t *)malloc(reply.bytes);
MemCopy(trans->bufferData, reply.buffer, reply.bytes); MemCopy(trans->bufferData, reply.buffer, reply.bytes);
NetTransSend(trans); NetTransSend(trans);
@ -570,7 +570,7 @@ bool JoinAgeRequestTrans::Recv (
//============================================================================ //============================================================================
RcvdPropagatedBufferTrans::~RcvdPropagatedBufferTrans () { RcvdPropagatedBufferTrans::~RcvdPropagatedBufferTrans () {
FREE(bufferData); free(bufferData);
} }
//============================================================================ //============================================================================
@ -587,7 +587,7 @@ void RcvdPropagatedBufferTrans::Post () {
//============================================================================ //============================================================================
RcvdGameMgrMsgTrans::~RcvdGameMgrMsgTrans () { RcvdGameMgrMsgTrans::~RcvdGameMgrMsgTrans () {
FREE(bufferData); free(bufferData);
} }
//============================================================================ //============================================================================

8
Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp

@ -297,16 +297,16 @@ class ErrorStream : public NxUserOutputStream
static class HeapAllocator : public NxUserAllocator { static class HeapAllocator : public NxUserAllocator {
public: public:
void * malloc (NxU32 size) { void * malloc (NxU32 size) {
return ALLOC(size); return malloc(size);
} }
void * mallocDEBUG (NxU32 size, const char * fileName, int line) { void * mallocDEBUG (NxU32 size, const char * fileName, int line) {
return MemAlloc(size, 0, fileName, line); return MemAlloc(size, 0, fileName, line);
} }
void * realloc (void * memory, NxU32 size) { void * realloc (void * memory, NxU32 size) {
return REALLOC(memory, size); return realloc(memory, size);
} }
void free (void * memory) { void free (void * memory) {
FREE(memory); free(memory);
} }
} gHeapAllocator; } gHeapAllocator;
@ -380,7 +380,7 @@ void plSimulationMgr::Init()
{ {
// There was an error when creating the PhysX simulation // There was an error when creating the PhysX simulation
// ...then get rid of the simulation instance // ...then get rid of the simulation instance
DEL(gTheInstance); // clean up the memory we allocated delete gTheInstance; // clean up the memory we allocated
gTheInstance = nil; gTheInstance = nil;
} }
} }

2
Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp

@ -119,7 +119,7 @@ plStatusLogMgr::~plStatusLogMgr()
fDisplays->IUnlink(); fDisplays->IUnlink();
if( log->fFlags & plStatusLog::kDeleteForMe ) if( log->fFlags & plStatusLog::kDeleteForMe )
DEL(log); delete log;
} }
} }

62
Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp

@ -308,7 +308,7 @@ static void VaultNodeAddedDownloadCallback(ENetError result, void * param) {
} }
} }
DEL(notify); delete notify;
} }
} }
@ -796,7 +796,7 @@ void VaultCreateNodeTrans::Complete (ENetError result) {
node node
); );
DEL(this); delete this;
} }
@ -821,7 +821,7 @@ void VaultFindNodeTrans::VaultNodeFound (
nodeIdCount, nodeIdCount,
nodeIds nodeIds
); );
DEL(trans); delete trans;
} }
@ -870,7 +870,7 @@ void VaultDownloadTrans::VaultNodeFetched (
trans->cbParam trans->cbParam
); );
DEL(trans); delete trans;
} }
} }
@ -921,7 +921,7 @@ void VaultDownloadTrans::VaultNodeRefsFetched (
trans->cbParam trans->cbParam
); );
DEL(trans); delete trans;
} }
} }
@ -950,7 +950,7 @@ void VaultAgeInitTrans::AgeInitCallback (
ageInfoVaultId ageInfoVaultId
); );
DEL(trans); delete trans;
} }
@ -992,7 +992,7 @@ void AddChildNodeFetchTrans::VaultNodeRefsFetched (
trans->result, trans->result,
trans->cbParam trans->cbParam
); );
DEL(trans); delete trans;
} }
} }
@ -1016,7 +1016,7 @@ void AddChildNodeFetchTrans::VaultNodeFetched (
trans->result, trans->result,
trans->cbParam trans->cbParam
); );
DEL(trans); delete trans;
} }
} }
@ -1072,14 +1072,14 @@ void IRelVaultNode::Unlink (RelVaultNode * other) {
link->link.Unlink(); link->link.Unlink();
// remove us from other's tables. // remove us from other's tables.
link->node->state->Unlink(node); link->node->state->Unlink(node);
DEL(link); delete link;
} }
if (nil != (link = children.Find(other->nodeId))) { if (nil != (link = children.Find(other->nodeId))) {
// make them non-findable in our children table // make them non-findable in our children table
link->link.Unlink(); link->link.Unlink();
// remove us from other's tables. // remove us from other's tables.
link->node->state->Unlink(node); link->node->state->Unlink(node);
DEL(link); delete link;
} }
} }
@ -1096,7 +1096,7 @@ RelVaultNode::RelVaultNode () {
//============================================================================ //============================================================================
RelVaultNode::~RelVaultNode () { RelVaultNode::~RelVaultNode () {
DEL(state); delete state;
} }
//============================================================================ //============================================================================
@ -1474,7 +1474,7 @@ void VaultRegisterCallback (VaultCallback * cb) {
//============================================================================ //============================================================================
void VaultUnregisterCallback (VaultCallback * cb) { void VaultUnregisterCallback (VaultCallback * cb) {
ASSERT(cb->internal); ASSERT(cb->internal);
DEL(cb->internal); delete cb->internal;
cb->internal = nil; cb->internal = nil;
} }
@ -1510,7 +1510,7 @@ void VaultDestroy () {
for (; link; link = next) { for (; link; link = next) {
next = s_nodes.Next(link); next = s_nodes.Next(link);
link->node->state->UnlinkFromRelatives(); link->node->state->UnlinkFromRelatives();
DEL(link); delete link;
} }
} }
@ -2809,7 +2809,7 @@ namespace _VaultRegisterOwnedAge {
void* fAgeInfoId; void* fAgeInfoId;
~_Params() { ~_Params() {
DEL(fSpawn); delete fSpawn;
} }
}; };
@ -2831,7 +2831,7 @@ namespace _VaultRegisterOwnedAge {
void _CreateAgeLinkNode(ENetError result, void* state, void* param, RelVaultNode* node) { void _CreateAgeLinkNode(ENetError result, void* state, void* param, RelVaultNode* node) {
if (IS_NET_ERROR(result)) { if (IS_NET_ERROR(result)) {
LogMsg(kLogError, "VaultRegisterOwnedAge: Failed to create AgeLink (async)"); LogMsg(kLogError, "VaultRegisterOwnedAge: Failed to create AgeLink (async)");
DEL(param); delete param;
return; return;
} }
@ -2868,13 +2868,13 @@ namespace _VaultRegisterOwnedAge {
// Don't leak memory // Don't leak memory
agesIOwn->DecRef(); agesIOwn->DecRef();
plyrInfo->DecRef(); plyrInfo->DecRef();
DEL(p); delete p;
} }
void _DownloadCallback(ENetError result, void* param) { void _DownloadCallback(ENetError result, void* param) {
if (IS_NET_ERROR(result)) { if (IS_NET_ERROR(result)) {
LogMsg(kLogError, "VaultRegisterOwnedAge: Failed to download age vault (async)"); LogMsg(kLogError, "VaultRegisterOwnedAge: Failed to download age vault (async)");
DEL(param); delete param;
} else } else
VaultCreateNode(plVault::kNodeType_AgeLink, (FVaultCreateNodeCallback)_CreateAgeLinkNode, nil, param); VaultCreateNode(plVault::kNodeType_AgeLink, (FVaultCreateNodeCallback)_CreateAgeLinkNode, nil, param);
} }
@ -3183,14 +3183,14 @@ namespace _VaultRegisterVisitAge {
void* fAgeInfoId; void* fAgeInfoId;
~_Params() { ~_Params() {
DEL(fSpawn); delete fSpawn;
} }
}; };
void _CreateAgeLinkNode(ENetError result, void* state, void* param, RelVaultNode* node) { void _CreateAgeLinkNode(ENetError result, void* state, void* param, RelVaultNode* node) {
if (IS_NET_ERROR(result)) { if (IS_NET_ERROR(result)) {
LogMsg(kLogError, "RegisterVisitAge: Failed to create AgeLink (async)"); LogMsg(kLogError, "RegisterVisitAge: Failed to create AgeLink (async)");
DEL(param); delete param;
return; return;
} }
@ -3225,13 +3225,13 @@ namespace _VaultRegisterVisitAge {
msg->Send(); msg->Send();
//Don't leak memory //Don't leak memory
DEL(param); delete param;
} }
void _DownloadCallback(ENetError result, void* param) { void _DownloadCallback(ENetError result, void* param) {
if (IS_NET_ERROR(result)) { if (IS_NET_ERROR(result)) {
LogMsg(kLogError, "RegisterVisitAge: Failed to download age vault (async)"); LogMsg(kLogError, "RegisterVisitAge: Failed to download age vault (async)");
DEL(param); delete param;
return; return;
} }
@ -3242,7 +3242,7 @@ namespace _VaultRegisterVisitAge {
void _InitAgeCallback(ENetError result, void* state, void* param, uint32_t ageVaultId, uint32_t ageInfoId) { void _InitAgeCallback(ENetError result, void* state, void* param, uint32_t ageVaultId, uint32_t ageInfoId) {
if (IS_NET_ERROR(result)) { if (IS_NET_ERROR(result)) {
LogMsg(kLogError, "RegisterVisitAge: Failed to init age vault (async)"); LogMsg(kLogError, "RegisterVisitAge: Failed to init age vault (async)");
DEL(param); delete param;
return; return;
} }
@ -3607,7 +3607,7 @@ bool VaultAmOwnerOfCurrentAge () {
plAgeInfoStruct info; plAgeInfoStruct info;
info.SetAgeFilename(ageFilename); info.SetAgeFilename(ageFilename);
FREE(ageFilename); free(ageFilename);
if (RelVaultNode * rvnLink = VaultGetOwnedAgeLinkIncRef(&info)) { if (RelVaultNode * rvnLink = VaultGetOwnedAgeLinkIncRef(&info)) {
@ -3979,7 +3979,7 @@ void VaultAgeRemoveDevice (const wchar_t deviceName[]) {
device->DecRef(); device->DecRef();
if (DeviceInbox * deviceInbox = s_ageDeviceInboxes.Find(CHashKeyStr(deviceName))) if (DeviceInbox * deviceInbox = s_ageDeviceInboxes.Find(CHashKeyStr(deviceName)))
DEL(device); delete device;
} }
templateNode->DecRef(); templateNode->DecRef();
folder->DecRef(); folder->DecRef();
@ -4098,7 +4098,7 @@ RelVaultNode * VaultAgeGetDeviceInboxIncRef (const wchar_t deviceName[]) {
//============================================================================ //============================================================================
void VaultClearDeviceInboxMap () { void VaultClearDeviceInboxMap () {
while (DeviceInbox * inbox = s_ageDeviceInboxes.Head()) { while (DeviceInbox * inbox = s_ageDeviceInboxes.Head()) {
DEL(inbox); delete inbox;
} }
} }
@ -4782,7 +4782,7 @@ namespace _VaultCreateChildAge {
void _CreateNodeCallback(ENetError result, void* state, void* param, RelVaultNode* node) { void _CreateNodeCallback(ENetError result, void* state, void* param, RelVaultNode* node) {
if (IS_NET_ERROR(result)) { if (IS_NET_ERROR(result)) {
LogMsg(kLogError, "CreateChildAge: Failed to create AgeLink (async)"); LogMsg(kLogError, "CreateChildAge: Failed to create AgeLink (async)");
DEL(param); delete param;
return; return;
} }
@ -4799,13 +4799,13 @@ namespace _VaultCreateChildAge {
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId);
msg->Send(); msg->Send();
DEL(param); delete param;
} }
void _DownloadCallback(ENetError result, void* param) { void _DownloadCallback(ENetError result, void* param) {
if (IS_NET_ERROR(result)) { if (IS_NET_ERROR(result)) {
LogMsg(kLogError, "CreateChildAge: Failed to download age vault (async)"); LogMsg(kLogError, "CreateChildAge: Failed to download age vault (async)");
DEL(param); delete param;
return; return;
} }
@ -4820,7 +4820,7 @@ namespace _VaultCreateChildAge {
void _InitAgeCallback(ENetError result, void* state, void* param, uint32_t ageVaultId, uint32_t ageInfoId) { void _InitAgeCallback(ENetError result, void* state, void* param, uint32_t ageVaultId, uint32_t ageInfoId) {
if (IS_NET_ERROR(result)) { if (IS_NET_ERROR(result)) {
LogMsg(kLogError, "CreateChildAge: Failed to init age (async)"); LogMsg(kLogError, "CreateChildAge: Failed to init age (async)");
DEL(param); delete param;
return; return;
} }
@ -4999,7 +4999,7 @@ void VaultCull (unsigned vaultId) {
if (RelVaultNodeLink * link = s_nodes.Find(vaultId)) { if (RelVaultNodeLink * link = s_nodes.Find(vaultId)) {
LogMsg(kLogDebug, L"Vault: Culling node %u", link->node->nodeId); LogMsg(kLogDebug, L"Vault: Culling node %u", link->node->nodeId);
link->node->state->UnlinkFromRelatives(); link->node->state->UnlinkFromRelatives();
DEL(link); delete link;
} }
// Remove all orphaned nodes from the global table // Remove all orphaned nodes from the global table
@ -5022,7 +5022,7 @@ void VaultCull (unsigned vaultId) {
if (!foundRoot) { if (!foundRoot) {
LogMsg(kLogDebug, L"Vault: Culling node %u", link->node->nodeId); LogMsg(kLogDebug, L"Vault: Culling node %u", link->node->nodeId);
link->node->state->UnlinkFromRelatives(); link->node->state->UnlinkFromRelatives();
DEL(link); delete link;
} }
} }
} }

12
Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp

@ -491,7 +491,7 @@ bool VaultTextNoteNode::GetVisitInfo (plAgeInfoStruct * info) {
} }
} }
FREE(mem); free(mem);
return true; return true;
} }
#endif #endif
@ -539,7 +539,7 @@ bool VaultSDLNode::GetStateDataRecord (plStateDataRecord * rec, unsigned readOpt
return false; return false;
rec->SetDescriptor(sdlRecName, sdlRecVersion); rec->SetDescriptor(sdlRecName, sdlRecVersion);
FREE(sdlRecName); free(sdlRecName);
// Note: Setting from default here results in a bug causing age SDL to // Note: Setting from default here results in a bug causing age SDL to
// be incorrectly shown when immediately linking back to an age you linked // be incorrectly shown when immediately linking back to an age you linked
@ -576,7 +576,7 @@ void VaultSDLNode::SetStateDataRecord (const plStateDataRecord * rec, unsigned w
IVaultNodeSetBlob(kSDLData, base, &sdlData, &sdlDataLen, buf, bytes); IVaultNodeSetBlob(kSDLData, base, &sdlData, &sdlDataLen, buf, bytes);
FREE(heap); free(heap);
} }
#endif // def CLIENT #endif // def CLIENT
@ -586,7 +586,7 @@ void VaultSDLNode::InitStateDataRecord (const wchar_t sdlRecName[], unsigned wri
{ {
plStateDataRecord * rec = NEWZERO(plStateDataRecord); plStateDataRecord * rec = NEWZERO(plStateDataRecord);
bool exists = GetStateDataRecord(rec, 0); bool exists = GetStateDataRecord(rec, 0);
DEL(rec); delete rec;
if (exists) if (exists)
return; return;
} }
@ -640,11 +640,11 @@ void VaultImageNode::StuffImage (plMipmap * src) {
plJPEG::Instance().SetWriteQuality(30/*percent*/); plJPEG::Instance().SetWriteQuality(30/*percent*/);
if (plJPEG::Instance().WriteToStream(&ramStream, src)) { if (plJPEG::Instance().WriteToStream(&ramStream, src)) {
unsigned bytes = ramStream.GetEOF(); unsigned bytes = ramStream.GetEOF();
uint8_t * buffer = (uint8_t *)ALLOC(bytes); uint8_t * buffer = (uint8_t *)malloc(bytes);
ramStream.CopyToMem(buffer); ramStream.CopyToMem(buffer);
IVaultNodeSetBlob(kImageData, base, &imgData, &imgDataLen, buffer, bytes); IVaultNodeSetBlob(kImageData, base, &imgData, &imgDataLen, buffer, bytes);
SetImageType(kJPEG); SetImageType(kJPEG);
FREE(buffer); free(buffer);
} }
else { else {
IVaultNodeSetBlob(kImageData, base, &imgData, &imgDataLen, nil, 0); IVaultNodeSetBlob(kImageData, base, &imgData, &imgDataLen, nil, 0);

Loading…
Cancel
Save