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. 4
      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. 8
      Sources/Plasma/FeatureLib/pfCharacter/pfMarkerMgr.cpp
  7. 6
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
  8. 2
      Sources/Plasma/FeatureLib/pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp
  9. 2
      Sources/Plasma/FeatureLib/pfGameMgr/ClimbingWall/pfGmClimbingWall.cpp
  10. 2
      Sources/Plasma/FeatureLib/pfGameMgr/Heek/pfGmHeek.cpp
  11. 4
      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. 2
      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. 6
      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

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

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

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

@ -409,7 +409,7 @@ static void DispatchEvents (HWND hwnd) {
DISPATCH(SetBytesRemaining);
DEFAULT_FATAL(event->type);
}
DEL(event); // unlinks from list
delete event; // unlinks from list
}
#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"
/****************************************************************************
*
* Allocation functions
@ -168,7 +167,6 @@ inline void CDECL operator delete (void *, void *) {}
#define ALLOC(b) MemAlloc(b, 0, __FILE__, __LINE__)
#define ALLOCZERO(b) MemAlloc(b, kMemZero, __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 REALLOC(p, b) MemRealloc(p, b, 0, __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 NEWFLAGS(t, f) new(MemAlloc(sizeof(t), (f), __FILE__, __LINE__)) t
#define NEWZERO(t) new(MemAlloc(sizeof(t), kMemZero, __FILE__, __LINE__)) t
#define DEL(t) delete (t)
#endif // __cplusplus

4
Sources/Plasma/CoreLib/hsStlUtils.h

@ -114,12 +114,12 @@ public:
void deallocate(pointer _Ptr, size_type)
{ // deallocate object at _Ptr, ignore size
FREE(_Ptr);
free(_Ptr);
}
pointer allocate(size_type _Count)
{ // allocate array of _Count elements
return (pointer)ALLOC(_Count * sizeof(_Ty));
return (pointer)malloc(_Count * sizeof(_Ty));
}
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)
{
int count = hsStrlen(src);
dst = (char *)ALLOC(count + 1);
dst = (char *)malloc(count + 1);
memcpy(dst, src, count);
dst[count] = 0;
return dst;

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

@ -103,7 +103,7 @@ void pfMarkerMgr::IShutdown()
while (curMarker != fMarkers.end())
{
curMarker->second->Remove();
DEL(curMarker->second);
delete curMarker->second;
++curMarker;
}
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
fMarkers[id]->Remove();
DEL(fMarkers[id]);
delete fMarkers[id];
}
hsPoint3 pos((float)x, (float)y, (float)z);
@ -178,7 +178,7 @@ void pfMarkerMgr::RemoveMarker(uint32_t id)
if (fMarkers.find(id) == fMarkers.end())
return;
fMarkers[id]->Remove();
DEL(fMarkers[id]);
delete fMarkers[id];
fMarkers.erase(id);
}
@ -188,7 +188,7 @@ void pfMarkerMgr::RemoveAllMarkers()
while (curMarker != fMarkers.end())
{
curMarker->second->Remove();
DEL(curMarker->second);
delete curMarker->second;
++curMarker;
}
fMarkers.clear();

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);
if (!VaultAgeGetAgeSDL(rec)) {
PrintString("Age SDL not found");
DEL(rec);
delete rec;
return;
}
@ -6106,14 +6106,14 @@ PF_CONSOLE_CMD(Age, ShowSDL, "", "Prints the age SDL values")
char * str = simple->GetAsString(j);
StrPack(line, str, arrsize(line));
StrPack(line, ",", arrsize(line));
FREE(str);
free(str);
}
PrintString(line);
plStatusLog::AddLineS("ShowSDL.log", "%s", line);
}
}
DEL(rec);
delete rec;
}
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 () {
DEL(internal);
delete internal;
}
//============================================================================

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

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

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

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

4
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());
if (!msg.failed)
DEL(gameCli); // we're done
delete gameCli; // we're done
}
//============================================================================
@ -280,7 +280,7 @@ pfGmMarker::pfGmMarker (
//============================================================================
pfGmMarker::~pfGmMarker () {
DEL(internal);
delete internal;
}
//============================================================================

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->Send(gameCli->GetReceiver());
DEL(gameCli); // we're done
delete gameCli; // we're done
}
//============================================================================
@ -210,7 +210,7 @@ pfGmTicTacToe::pfGmTicTacToe (
//============================================================================
pfGmTicTacToe::~pfGmTicTacToe () {
DEL(internal);
delete internal;
}
//============================================================================

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

@ -202,7 +202,7 @@ 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 () {
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;
}
DEL(state);
delete state;
}
//============================================================================
@ -228,7 +228,7 @@ void IGameMgr::Recv (GameMsgHeader * msg) {
void * param;
if (TransState * trans = s_trans.Find(msg->transId)) {
param = trans->param;
DEL(trans);
delete trans;
}
else {
param = nil;
@ -280,13 +280,13 @@ pfGameMgrMsg::pfGameMgrMsg () {
//============================================================================
pfGameMgrMsg::~pfGameMgrMsg () {
FREE(netMsg);
free(netMsg);
}
//============================================================================
void pfGameMgrMsg::Set (const GameMsgHeader & msg) {
netMsg = (GameMsgHeader *)ALLOC(msg.messageBytes);
netMsg = (GameMsgHeader *)malloc(msg.messageBytes);
MemCopy(netMsg, &msg, msg.messageBytes);
}
@ -307,13 +307,13 @@ pfGameCliMsg::pfGameCliMsg () {
//============================================================================
pfGameCliMsg::~pfGameCliMsg () {
FREE(netMsg);
free(netMsg);
}
//============================================================================
void pfGameCliMsg::Set (pfGameCli * cli, const GameMsgHeader & msg) {
netMsg = (GameMsgHeader *)ALLOC(msg.messageBytes);
netMsg = (GameMsgHeader *)malloc(msg.messageBytes);
MemCopy(netMsg, &msg, msg.messageBytes);
gameCli = cli;
}
@ -475,7 +475,7 @@ 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))
{
DEL(link);
delete link;
}
}

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

@ -155,15 +155,15 @@ struct LocAgeInfo
//////////////////////////////////////////////////////////////////////
static void * XMLCALL XmlMalloc (size_t size) {
return ALLOC(size);
return malloc(size);
}
static void * XMLCALL XmlRealloc (void * ptr, size_t size) {
return REALLOC(ptr, size);
return realloc(ptr, size);
}
static void XMLCALL XmlFree (void * ptr) {
FREE(ptr);
free(ptr);
}
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);
NetCommChangeMyPassword(wpassword);
FREE(wpassword);
free(wpassword);
}

2
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;
PyUnicode_AsWideChar((PyUnicodeObject*)message, msg, size);
uint32_t retval = cyMisc::SendRTChat(*fromPlayer, toPlayerList, msg, msgFlags);
DEL(msg);
delete msg;
return PyLong_FromUnsignedLong(retval);
}
else

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);
FREE(wEntryName);
FREE(wEntryValue);
free(wEntryName);
free(wEntryValue);
}
// AGE DEVICES. AKA IMAGERS, WHATEVER.
@ -311,7 +311,7 @@ PyObject * pyAgeVault::GetAgeSDL() const
{
plStateDataRecord * rec = NEWZERO(plStateDataRecord);
if (!VaultAgeGetAgeSDL(rec)) {
DEL(rec);
delete rec;
PYTHON_RETURN_NONE;
}
else {

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

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

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

@ -56,7 +56,7 @@ pySDLStateDataRecord::pySDLStateDataRecord( plStateDataRecord * rec )
}
pySDLStateDataRecord::~pySDLStateDataRecord() {
DEL(fRec);
delete fRec;
}
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)
VaultAddChronicleEntryAndWait(wEntryName, type, wEntryValue);
FREE(wEntryName);
FREE(wEntryValue);
free(wEntryName);
free(wEntryValue);
}
@ -452,7 +452,7 @@ PyObject* pyVault::GetPsnlAgeSDL() const
if (sdl.GetStateDataRecord(rec, plSDL::kKeepDirty))
result = pySDLStateDataRecord::New(rec);
else
DEL(rec);
delete rec;
rvnSdl->DecRef();
}
rvnInfo->DecRef();

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

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

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

@ -245,7 +245,7 @@ void pyVaultImageNode::SetImageFromScrShot()
else {
access.SetImageData(nil, 0);
access.SetImageType(VaultImageNode::kNone);
DEL(fMipmap);
delete fMipmap;
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) {
@ -191,8 +191,8 @@ pyVaultNode::~pyVaultNode()
{
if (fNode)
fNode->DecRef("pyVaultNode");
FREE(fCreateAgeGuid);
FREE(fCreateAgeName);
free(fCreateAgeGuid);
free(fCreateAgeName);
}
@ -335,7 +335,7 @@ const char * pyVaultNode::GetCreateAgeGuid( void )
return fCreateAgeGuid;
if (fNode) {
fCreateAgeGuid = (char*)ALLOC(64);
fCreateAgeGuid = (char*)malloc(64);
GuidToString(fNode->createAgeUuid, fCreateAgeGuid, 64);
}
@ -383,7 +383,7 @@ void pyVaultNode::SetCreatorNodeID( uint32_t v )
void pyVaultNode::SetCreateAgeName( const char * v )
{
FREE(fCreateAgeName);
free(fCreateAgeName);
fCreateAgeName = nil;
ASSERT(fNode);
@ -394,7 +394,7 @@ void pyVaultNode::SetCreateAgeName( const char * v )
void pyVaultNode::SetCreateAgeGuid( const char * v )
{
FREE(fCreateAgeGuid);
free(fCreateAgeGuid);
fCreateAgeGuid = nil;
ASSERT(fNode);

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

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

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

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

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

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

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

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

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

@ -102,7 +102,7 @@ void CNtWaitHandle::IncRef () {
//===========================================================================
void CNtWaitHandle::DecRef () {
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();
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
if (!port->listenCount) {
DEL(port);
delete port;
continue;
}
@ -980,7 +980,7 @@ void INtSocketOpCompleteSocketConnect (NtOpConnAttempt * op) {
// and because connection attempts are not waitable
ASSERT(!op->link.IsLinked());
ASSERT(!op->signalComplete);
DEL(op);
delete op;
PerfSubCounter(kAsyncPerfSocketConnAttemptsOutCurr, 1);
}
@ -1259,7 +1259,7 @@ void NtSocketDelete (AsyncSocket conn) {
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) {
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
DEL(command);
delete command;
// Handle failure to connect
if (error) {
// Destroy the socket
DEL(this);
delete this;
}
@ -643,7 +643,7 @@ void CSocket::ProcessQueue () {
}
// Delete the command
DEL(command);
delete command;
}
@ -1105,7 +1105,7 @@ void W9xSocketDelete (
// Delete the object
s_critSect.Enter();
DEL(object);
delete object;
s_critSect.Leave();
}

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

@ -234,7 +234,7 @@ static unsigned CALLBACK W9xThreadProc (AsyncThread *) {
if (rec) {
s_dispInProcList.Link(rec);
rec->Complete(&s_critSect);
DEL(rec);
delete rec;
timeout = 0;
}
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
// and because connection attempts are not waitable
ASSERT(!lookup->link.IsLinked());
DEL(lookup);
delete lookup;
PerfSubCounter(kAsyncPerfNameLookupAttemptsCurr, 1);
}

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

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

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

@ -553,7 +553,7 @@ void AsyncSocketUnregisterNotifyProc (
s_notifyProcLock.LeaveWrite();
// 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) {
case kNotifyFileWrite:
FREE(notify->param);
free(notify->param);
AtomicAdd(&s_opsPending, -1);
break;
@ -171,7 +171,7 @@ static void AllocLogBuffer_CS (unsigned index) {
//============================================================================
static void FreeLogBuffer_CS (unsigned index) {
if (s_logBuf[index]) {
FREE(s_logBuf[index]);
free(s_logBuf[index]);
s_logBuf[index] = nil;
}
}
@ -279,7 +279,7 @@ static void WriteLogFile_CS (unsigned index, bool close) {
s_logBuf[index]
);
if (flags == kAsyncFileRwSync)
DEL(s_logBuf[index]);
delete s_logBuf[index];
else
AtomicAdd(&s_opsPending, 1);
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);
// Cleanup thread
DEL(thread);
delete thread;
PerfSubCounter(kAsyncPerfThreadsCurr, 1);
return result;

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

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

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

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

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

@ -90,7 +90,7 @@ IniValue::~IniValue () {
wchar_t ** cur = fArgs.Ptr();
wchar_t ** end = fArgs.Term();
for (; cur < end; ++cur)
FREE(*cur);
free(*cur);
}
//===========================================================================
@ -124,7 +124,7 @@ IniKey::~IniKey () {
IniValue ** cur = fValues.Ptr();
IniValue ** end = fValues.Term();
for (; cur < end; ++cur)
DEL(*cur);
delete *cur;
}
//===========================================================================
@ -430,12 +430,12 @@ static bool ParseFile (
}
}
FREE(src);
free(src);
buffer = (uint8_t *) dst;
}
ParseBuffer(ini, (const wchar_t *) buffer);
FREE(buffer);
free(buffer);
result = true;
}
@ -464,7 +464,7 @@ Ini * IniOpen (
//===========================================================================
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();
// 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) ) {
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 {
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;
const unsigned kStackBufSize = 8 * 1024;
if (bytes > kStackBufSize)
packed = (char *) ALLOC(bytes);
packed = (char *) malloc(bytes);
else
packed = (char *) _alloca(bytes);
@ -467,7 +467,7 @@ static void __cdecl Send (
// Free the string
if (bytes > kStackBufSize)
FREE(packed);
free(packed);
}
//===========================================================================

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

@ -110,7 +110,7 @@ ChannelCrit::~ChannelCrit () {
channel->DecRef("ChannelLink");
}
DEL(s_channels);
delete s_channels;
s_channels = nil;
}
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);
else
// 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);
CryptEncrypt(cli->cryptOut, bytes, temp);
@ -205,7 +205,7 @@ static void PutBufferOnWire (NetCli * cli, void * data, unsigned bytes) {
AsyncSocketSend(cli->sock, data, bytes);
// free heap buffer (if any)
FREE(heap);
free(heap);
}
//============================================================================
@ -227,10 +227,10 @@ static void AddToSendBuffer (
if (bytes > arrsize(cli->sendBuffer)) {
// Let the OS fragment oversize buffers
FlushSendBuffer(cli);
void * heap = ALLOC(bytes);
void * heap = malloc(bytes);
MemCopy(heap, data, bytes);
PutBufferOnWire(cli, heap, bytes);
FREE(heap);
free(heap);
}
else {
for (;;) {
@ -1079,7 +1079,7 @@ void NetCliDelete (
cli->input.Clear();
cli->recvBuffer.Clear();
DEL(cli);
delete cli;
}
//============================================================================
@ -1120,7 +1120,7 @@ bool NetCliDispatch (
temp = ALLOCA(uint8_t, bytes);
else
// 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);
CryptDecrypt(cli->cryptIn, bytes, temp);
@ -1153,7 +1153,7 @@ bool NetCliDispatch (
#endif
// free heap buffer (if any)
FREE(heap);
free(heap);
cli->input.Compact();
return cli->recvDispatch;

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

@ -113,7 +113,7 @@ static void LookupCallback (
);
}
p->diag->DecRef("DNS");
DEL(p);
delete p;
}
@ -190,5 +190,5 @@ void NetDiagDns (
0,
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->diag->DecRef("ICMP");
DEL(p);
delete p;
}

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

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

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

@ -82,7 +82,7 @@ const wchar_t g_version[] = L"solvent";
NetDiag::~NetDiag () {
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();
{
FREE(hosts[srv]);
free(hosts[srv]);
if (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");
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);
}
else {
FREE(msgBuffer);
free(msgBuffer);
}
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);
*elems = bytes / sizeof(T);
T * src = (T *)*buffer;
DEL(*buf);
delete *buf;
*buf = (T *)ALLOC(bytes);
MemCopy(*buf, src, bytes);
*buffer += bytes;
@ -168,7 +168,7 @@ static inline void ICopyValue (T * plhs, const T & rhs) {
//============================================================================
template <typename T>
static inline void ICopyString (T ** plhs, const T rhs[]) {
FREE(*plhs);
free(*plhs);
if (rhs)
*plhs = StrDup(rhs);
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[]) {
FREE(*plhs);
free(*plhs);
if (rhs)
*plhs = StrDup(rhs);
else
@ -250,7 +250,7 @@ unsigned NetGameScore::Read(const uint8_t inbuffer[], unsigned bufsz, uint8_t**
IReadString(&tempstr, &buffer, &bufsz);
StrCopy(gameName, tempstr, arrsize(gameName));
DEL(tempstr);
delete tempstr;
if (end)
*end = buffer;
@ -302,7 +302,7 @@ unsigned NetGameRank::Read(const uint8_t inbuffer[], unsigned bufsz, uint8_t** e
IReadString(&tempstr, &buffer, &bufsz);
StrCopy(name, tempstr, arrsize(name));
DEL(tempstr);
delete tempstr;
if (end)
*end = buffer;
@ -341,7 +341,7 @@ static void DeallocNodeFields (NetVaultNode * node) {
if (fieldFlag > node->fieldFlags)
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) {
DELFIELD(kCreateAgeName, createAgeName);
DELFIELD(kString64_1, string64_1);

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

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

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

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

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

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

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

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

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

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

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

@ -78,7 +78,7 @@ struct CmdArgData {
~CmdArgData () {
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);
// Free memory
FREE(buffer);
free(buffer);
}
@ -350,7 +350,7 @@ bool CICmdParser::ProcessValue (CmdTokState * state, unsigned index, const wchar
case kCmdTypeString:
if (arg.buffer)
FREE(arg.buffer);
free(arg.buffer);
arg.buffer = StrDup(str);
arg.val.strVal = arg.buffer;
break;
@ -539,7 +539,7 @@ CCmdParser::CCmdParser (const CmdArgDef def[], unsigned defCount) {
//===========================================================================
CCmdParser::~CCmdParser () {
DEL(fParser);
delete fParser;
}
//===========================================================================

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

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

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

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

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

@ -485,7 +485,7 @@ void TList<T>::Clear () {
//===========================================================================
template<class T>
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
// so we can't make any assumptions about indices or counts of items in the array
while (C * head = Dequeue())
DEL(head);
delete head;
m_array.Clear();
}
@ -164,7 +164,7 @@ C * TPriorityQueue<C,P>::Delete (C * object) {
unsigned index = priority->GetIndex();
// delete the object
DEL(object);
delete object;
// return the next object in that queue
if (queue && (index < queue->Count()))

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

@ -168,7 +168,7 @@ public:
}
inline virtual void OnZeroRef () {
DEL(this);
delete this;
}
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>
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];
while (ptr != m_stop) {
Node * next = ptr->next[0];
DEL(ptr->object);
delete ptr->object;
FreeNode(ptr);
ptr = next;
}
@ -259,7 +259,7 @@ template<class T, class K, unsigned keyOffset, class Cmp>
void TSkipList<T,K,keyOffset,Cmp>::Delete (T * 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
while (m_allocHead) {
AllocNode * allocNext = m_allocHead->allocNext;
FREE(m_allocHead);
free(m_allocHead);
m_allocHead = allocNext;
}

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

@ -65,7 +65,7 @@ struct SubstParsedData {
}
~SubstBlock() {
FREE(data);
free(data);
}
};
@ -74,7 +74,7 @@ struct SubstParsedData {
~SubstParsedData() {
for (unsigned i = 0; i < blocks.Count(); ++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 );
DEL(fBuffer);;
delete fBuffer;
fBuffer = nil;
fBufferSize = 0;
fCursor = 0;

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

@ -82,7 +82,7 @@ void plOGGCodec::BuildActualWaveHeader()
int factdata = 0;
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+4, &size, 4);
memcpy(fHeadBuf+8, "WAVE", 4);
@ -189,12 +189,12 @@ plOGGCodec::~plOGGCodec()
void plOGGCodec::Close( void )
{
// plNetClientApp::StaticDebugMsg("Ogg Close, t=%f, start", hsTimer::GetSeconds());
FREE(fHeadBuf);
free(fHeadBuf);
fHeadBuf = nil;
if( fOggFile != nil )
{
ov_clear( fOggFile );
DEL(fOggFile);
delete fOggFile;
fOggFile = nil;
}

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

@ -973,7 +973,7 @@ void plClothingOutfit::WriteToVault(const ARRAY(plStateDataRecord*) & SDRs)
// Cleanup morph SDRs
{for (unsigned i = 0; i < morphs.Count(); ++i) {
DEL(morphs[i]);
delete morphs[i];
}}
rvn->DecRef();
@ -1614,7 +1614,7 @@ void plClothingMgr::GetClosetItems(hsTArray<plClosetItem> &out)
plStateDataRecord * rec = NEWZERO(plStateDataRecord);
if (sdl.GetStateDataRecord(rec, 0))
plClothingSDLModifier::HandleSingleSDR(rec, nil, &out[i]);
DEL(rec);
delete rec;
}
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)
{
return ALLOC(items*size);
return malloc(items*size);
}
void ZlibFree(voidpf opaque, voidpf address)
{
FREE(address);
free(address);
}
plZlibStream::plZlibStream() : fOutput(nil), fZStream(nil), fHeader(kNeedMoreData), fDecompressedOk(false)
@ -85,14 +85,14 @@ hsBool plZlibStream::Close()
if (fOutput)
{
fOutput->Close();
DEL(fOutput);
delete fOutput;
fOutput = nil;
}
if (fZStream)
{
z_streamp zstream = (z_streamp)fZStream;
inflateEnd(zstream);
DEL(zstream);
delete zstream;
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");
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);
file.Close();
unsigned memSize = min(bytesToRead, bytesRead);
memcpy(key, buffer, memSize);
FREE(buffer);
free(buffer);
return true;
}

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

@ -70,7 +70,7 @@ public:
plMessage(nil, nil, nil), fCmd( cmd ), fString(hsStrcpy(str))
{ SetBCastFlag( kBCastByExactType ); }
~plConsoleMsg() { FREE(fString); }
~plConsoleMsg() { free(fString); }
CLASSNAME_REGISTER( plConsoleMsg );
GETINTERFACE_ANY( plConsoleMsg, plMessage );
@ -79,7 +79,7 @@ public:
const char *GetString( void ) const { return fString; };
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)
{

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

@ -198,7 +198,7 @@ void plNCAgeJoiner::Complete (bool success, const char msg[]) {
notify.msg = msg;
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;
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());
NetCliAuthSendCCRPetition(wStr);
FREE(wStr);
free(wStr);
}
//
@ -470,5 +470,5 @@ void plNetClientMgr::StoreSDLState(const plStateDataRecord* sdRec, const plUoid&
}
SendMsg(msg);
DEL(msg);
delete msg;
}

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

@ -116,7 +116,7 @@ struct NlmLeaveAgeOp : NlmOp {
struct NlmOpNode {
LINK(NlmOpNode) link;
NlmOp * op;
~NlmOpNode () { DEL(op); }
~NlmOpNode () { delete op; }
};
@ -173,7 +173,7 @@ void plNetLinkingMgr::NCAgeJoinerCallback (
// Pull our wait op off exec queue
if (NlmOpWaitOp * waitOp = (NlmOpWaitOp *) userState)
DEL(waitOp->node);
delete waitOp->node;
}
break;
@ -195,7 +195,7 @@ void plNetLinkingMgr::NCAgeLeaverCallback (
// Pull our wait op off exec queue
if (NlmOpWaitOp * waitOp = (NlmOpWaitOp *) userState)
DEL(waitOp->node);
delete waitOp->node;
}
break;
@ -260,7 +260,7 @@ void plNetLinkingMgr::ExecNextOp () {
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->Send();
DEL(cp);
delete cp;
}
//============================================================================
@ -1180,7 +1180,7 @@ void NetCommRemoveMsgHandler (
continue;
// 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->bytes = reply.chunkSize;
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);
NetTransSend(writeTrans);
}
@ -3664,7 +3664,7 @@ bool FileDownloadRequestTrans::Recv (
//============================================================================
RcvdFileDownloadChunkTrans::~RcvdFileDownloadChunkTrans () {
FREE(data);
free(data);
}
//============================================================================
@ -3687,7 +3687,7 @@ void RcvdFileDownloadChunkTrans::Post () {
//============================================================================
RcvdPropagatedBufferTrans::~RcvdPropagatedBufferTrans () {
FREE(bufferData);
free(bufferData);
}
//============================================================================
@ -3845,10 +3845,10 @@ VaultInitAgeTrans::VaultInitAgeTrans (
//============================================================================
VaultInitAgeTrans::~VaultInitAgeTrans () {
FREE(m_ageFilename);
FREE(m_ageInstName);
FREE(m_ageUserName);
FREE(m_ageDesc);
free(m_ageFilename);
free(m_ageInstName);
free(m_ageUserName);
free(m_ageDesc);
}
//============================================================================

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

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

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

@ -1195,7 +1195,7 @@ bool DownloadRequestTrans::Recv (
RcvdFileDownloadChunkTrans * writeTrans = NEW(RcvdFileDownloadChunkTrans);
writeTrans->writer = m_writer;
writeTrans->bytes = byteCount;
writeTrans->data = (uint8_t *)ALLOC(byteCount);
writeTrans->data = (uint8_t *)malloc(byteCount);
MemCopy(writeTrans->data, data, byteCount);
NetTransSend(writeTrans);
}
@ -1217,7 +1217,7 @@ bool DownloadRequestTrans::Recv (
//============================================================================
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);
trans->bufferType = reply.type;
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);
NetTransSend(trans);
@ -473,7 +473,7 @@ static bool Recv_GameMgrMsg (
RcvdGameMgrMsgTrans * trans = NEW(RcvdGameMgrMsgTrans);
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);
NetTransSend(trans);
@ -570,7 +570,7 @@ bool JoinAgeRequestTrans::Recv (
//============================================================================
RcvdPropagatedBufferTrans::~RcvdPropagatedBufferTrans () {
FREE(bufferData);
free(bufferData);
}
//============================================================================
@ -587,7 +587,7 @@ void RcvdPropagatedBufferTrans::Post () {
//============================================================================
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 {
public:
void * malloc (NxU32 size) {
return ALLOC(size);
return malloc(size);
}
void * mallocDEBUG (NxU32 size, const char * fileName, int line) {
return MemAlloc(size, 0, fileName, line);
}
void * realloc (void * memory, NxU32 size) {
return REALLOC(memory, size);
return realloc(memory, size);
}
void free (void * memory) {
FREE(memory);
free(memory);
}
} gHeapAllocator;
@ -380,7 +380,7 @@ void plSimulationMgr::Init()
{
// There was an error when creating the PhysX simulation
// ...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;
}
}

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

@ -119,7 +119,7 @@ plStatusLogMgr::~plStatusLogMgr()
fDisplays->IUnlink();
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
);
DEL(this);
delete this;
}
@ -821,7 +821,7 @@ void VaultFindNodeTrans::VaultNodeFound (
nodeIdCount,
nodeIds
);
DEL(trans);
delete trans;
}
@ -870,7 +870,7 @@ void VaultDownloadTrans::VaultNodeFetched (
trans->cbParam
);
DEL(trans);
delete trans;
}
}
@ -921,7 +921,7 @@ void VaultDownloadTrans::VaultNodeRefsFetched (
trans->cbParam
);
DEL(trans);
delete trans;
}
}
@ -950,7 +950,7 @@ void VaultAgeInitTrans::AgeInitCallback (
ageInfoVaultId
);
DEL(trans);
delete trans;
}
@ -992,7 +992,7 @@ void AddChildNodeFetchTrans::VaultNodeRefsFetched (
trans->result,
trans->cbParam
);
DEL(trans);
delete trans;
}
}
@ -1016,7 +1016,7 @@ void AddChildNodeFetchTrans::VaultNodeFetched (
trans->result,
trans->cbParam
);
DEL(trans);
delete trans;
}
}
@ -1072,14 +1072,14 @@ void IRelVaultNode::Unlink (RelVaultNode * other) {
link->link.Unlink();
// remove us from other's tables.
link->node->state->Unlink(node);
DEL(link);
delete link;
}
if (nil != (link = children.Find(other->nodeId))) {
// make them non-findable in our children table
link->link.Unlink();
// remove us from other's tables.
link->node->state->Unlink(node);
DEL(link);
delete link;
}
}
@ -1096,7 +1096,7 @@ RelVaultNode::RelVaultNode () {
//============================================================================
RelVaultNode::~RelVaultNode () {
DEL(state);
delete state;
}
//============================================================================
@ -1474,7 +1474,7 @@ void VaultRegisterCallback (VaultCallback * cb) {
//============================================================================
void VaultUnregisterCallback (VaultCallback * cb) {
ASSERT(cb->internal);
DEL(cb->internal);
delete cb->internal;
cb->internal = nil;
}
@ -1510,7 +1510,7 @@ void VaultDestroy () {
for (; link; link = next) {
next = s_nodes.Next(link);
link->node->state->UnlinkFromRelatives();
DEL(link);
delete link;
}
}
@ -2809,7 +2809,7 @@ namespace _VaultRegisterOwnedAge {
void* fAgeInfoId;
~_Params() {
DEL(fSpawn);
delete fSpawn;
}
};
@ -2831,7 +2831,7 @@ namespace _VaultRegisterOwnedAge {
void _CreateAgeLinkNode(ENetError result, void* state, void* param, RelVaultNode* node) {
if (IS_NET_ERROR(result)) {
LogMsg(kLogError, "VaultRegisterOwnedAge: Failed to create AgeLink (async)");
DEL(param);
delete param;
return;
}
@ -2868,13 +2868,13 @@ namespace _VaultRegisterOwnedAge {
// Don't leak memory
agesIOwn->DecRef();
plyrInfo->DecRef();
DEL(p);
delete p;
}
void _DownloadCallback(ENetError result, void* param) {
if (IS_NET_ERROR(result)) {
LogMsg(kLogError, "VaultRegisterOwnedAge: Failed to download age vault (async)");
DEL(param);
delete param;
} else
VaultCreateNode(plVault::kNodeType_AgeLink, (FVaultCreateNodeCallback)_CreateAgeLinkNode, nil, param);
}
@ -3183,14 +3183,14 @@ namespace _VaultRegisterVisitAge {
void* fAgeInfoId;
~_Params() {
DEL(fSpawn);
delete fSpawn;
}
};
void _CreateAgeLinkNode(ENetError result, void* state, void* param, RelVaultNode* node) {
if (IS_NET_ERROR(result)) {
LogMsg(kLogError, "RegisterVisitAge: Failed to create AgeLink (async)");
DEL(param);
delete param;
return;
}
@ -3225,13 +3225,13 @@ namespace _VaultRegisterVisitAge {
msg->Send();
//Don't leak memory
DEL(param);
delete param;
}
void _DownloadCallback(ENetError result, void* param) {
if (IS_NET_ERROR(result)) {
LogMsg(kLogError, "RegisterVisitAge: Failed to download age vault (async)");
DEL(param);
delete param;
return;
}
@ -3242,7 +3242,7 @@ namespace _VaultRegisterVisitAge {
void _InitAgeCallback(ENetError result, void* state, void* param, uint32_t ageVaultId, uint32_t ageInfoId) {
if (IS_NET_ERROR(result)) {
LogMsg(kLogError, "RegisterVisitAge: Failed to init age vault (async)");
DEL(param);
delete param;
return;
}
@ -3607,7 +3607,7 @@ bool VaultAmOwnerOfCurrentAge () {
plAgeInfoStruct info;
info.SetAgeFilename(ageFilename);
FREE(ageFilename);
free(ageFilename);
if (RelVaultNode * rvnLink = VaultGetOwnedAgeLinkIncRef(&info)) {
@ -3979,7 +3979,7 @@ void VaultAgeRemoveDevice (const wchar_t deviceName[]) {
device->DecRef();
if (DeviceInbox * deviceInbox = s_ageDeviceInboxes.Find(CHashKeyStr(deviceName)))
DEL(device);
delete device;
}
templateNode->DecRef();
folder->DecRef();
@ -4098,7 +4098,7 @@ RelVaultNode * VaultAgeGetDeviceInboxIncRef (const wchar_t deviceName[]) {
//============================================================================
void VaultClearDeviceInboxMap () {
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) {
if (IS_NET_ERROR(result)) {
LogMsg(kLogError, "CreateChildAge: Failed to create AgeLink (async)");
DEL(param);
delete param;
return;
}
@ -4799,13 +4799,13 @@ namespace _VaultCreateChildAge {
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId);
msg->Send();
DEL(param);
delete param;
}
void _DownloadCallback(ENetError result, void* param) {
if (IS_NET_ERROR(result)) {
LogMsg(kLogError, "CreateChildAge: Failed to download age vault (async)");
DEL(param);
delete param;
return;
}
@ -4820,7 +4820,7 @@ namespace _VaultCreateChildAge {
void _InitAgeCallback(ENetError result, void* state, void* param, uint32_t ageVaultId, uint32_t ageInfoId) {
if (IS_NET_ERROR(result)) {
LogMsg(kLogError, "CreateChildAge: Failed to init age (async)");
DEL(param);
delete param;
return;
}
@ -4999,7 +4999,7 @@ void VaultCull (unsigned vaultId) {
if (RelVaultNodeLink * link = s_nodes.Find(vaultId)) {
LogMsg(kLogDebug, L"Vault: Culling node %u", link->node->nodeId);
link->node->state->UnlinkFromRelatives();
DEL(link);
delete link;
}
// Remove all orphaned nodes from the global table
@ -5022,7 +5022,7 @@ void VaultCull (unsigned vaultId) {
if (!foundRoot) {
LogMsg(kLogDebug, L"Vault: Culling node %u", link->node->nodeId);
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;
}
#endif
@ -539,7 +539,7 @@ bool VaultSDLNode::GetStateDataRecord (plStateDataRecord * rec, unsigned readOpt
return false;
rec->SetDescriptor(sdlRecName, sdlRecVersion);
FREE(sdlRecName);
free(sdlRecName);
// 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
@ -576,7 +576,7 @@ void VaultSDLNode::SetStateDataRecord (const plStateDataRecord * rec, unsigned w
IVaultNodeSetBlob(kSDLData, base, &sdlData, &sdlDataLen, buf, bytes);
FREE(heap);
free(heap);
}
#endif // def CLIENT
@ -586,7 +586,7 @@ void VaultSDLNode::InitStateDataRecord (const wchar_t sdlRecName[], unsigned wri
{
plStateDataRecord * rec = NEWZERO(plStateDataRecord);
bool exists = GetStateDataRecord(rec, 0);
DEL(rec);
delete rec;
if (exists)
return;
}
@ -640,11 +640,11 @@ void VaultImageNode::StuffImage (plMipmap * src) {
plJPEG::Instance().SetWriteQuality(30/*percent*/);
if (plJPEG::Instance().WriteToStream(&ramStream, src)) {
unsigned bytes = ramStream.GetEOF();
uint8_t * buffer = (uint8_t *)ALLOC(bytes);
uint8_t * buffer = (uint8_t *)malloc(bytes);
ramStream.CopyToMem(buffer);
IVaultNodeSetBlob(kImageData, base, &imgData, &imgDataLen, buffer, bytes);
SetImageType(kJPEG);
FREE(buffer);
free(buffer);
}
else {
IVaultNodeSetBlob(kImageData, base, &imgData, &imgDataLen, nil, 0);

Loading…
Cancel
Save