Browse Source

Plug some simple leaks detected during startup

Michael Hansen 12 years ago
parent
commit
abbbfc12d7
  1. 14
      Sources/Plasma/FeatureLib/pfSecurePreloader/pfSecurePreloader.cpp
  2. 2
      Sources/Plasma/FeatureLib/pfSecurePreloader/pfSecurePreloader.h
  3. 4
      Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h
  4. 7
      Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp
  5. 3
      Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.h
  6. 7
      Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp
  7. 1
      Sources/Plasma/PubUtilLib/plPipeline/plBinkPlayer.h

14
Sources/Plasma/FeatureLib/pfSecurePreloader/pfSecurePreloader.cpp

@ -269,10 +269,13 @@ void pfSecurePreloader::PreloadNextFile()
void pfSecurePreloader::Init() void pfSecurePreloader::Init()
{ {
RegisterAs(kSecurePreloader_KEY); if (!fInstance)
fInstance = new pfSecurePreloader;
fInstance->RegisterAs(kSecurePreloader_KEY);
// TODO: If we're going to support reconnects, then let's do it right. // TODO: If we're going to support reconnects, then let's do it right.
// Later... // Later...
//plgDispatch::Dispatch()->RegisterForExactType(plNetCommAuthConnectedMsg::Index(), GetKey()); //plgDispatch::Dispatch()->RegisterForExactType(plNetCommAuthConnectedMsg::Index(), fInstance->GetKey());
} }
void pfSecurePreloader::Start() void pfSecurePreloader::Start()
@ -431,10 +434,3 @@ void pfSecurePreloader::FilePreloaded(const wchar_t* file, hsStream* stream)
// Continue down the warpath // Continue down the warpath
PreloadNextFile(); PreloadNextFile();
} }
pfSecurePreloader* pfSecurePreloader::GetInstance()
{
if (!fInstance)
fInstance = new pfSecurePreloader;
return fInstance;
}

2
Sources/Plasma/FeatureLib/pfSecurePreloader/pfSecurePreloader.h

@ -90,7 +90,7 @@ public:
plOperationProgress* GetProgressBar() { return fProgress; } plOperationProgress* GetProgressBar() { return fProgress; }
static pfSecurePreloader* GetInstance(); static pfSecurePreloader* GetInstance() { return fInstance; }
static void SetInstance(pfSecurePreloader* instance) { fInstance = instance; } static void SetInstance(pfSecurePreloader* instance) { fInstance = instance; }
}; };

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

@ -208,8 +208,8 @@ struct NetVaultNode : AtomicRef {
CCritSect critsect; CCritSect critsect;
uint64_t fieldFlags; uint64_t fieldFlags;
uint64_t dirtyFlags; uint64_t dirtyFlags;
plUUID revisionId; plUUID revisionId;

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

@ -279,6 +279,13 @@ plNetLinkingMgr::plNetLinkingMgr()
{ {
} }
plNetLinkingMgr::~plNetLinkingMgr()
{
std::for_each(s_opqueue.begin(), s_opqueue.end(),
[](NlmOp * op) { delete op; }
);
}
plNetLinkingMgr * plNetLinkingMgr::GetInstance() plNetLinkingMgr * plNetLinkingMgr::GetInstance()
{ {
static plNetLinkingMgr Instance; static plNetLinkingMgr Instance;

3
Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.h

@ -76,7 +76,8 @@ class plNetLinkingMgr
plNetLinkingMgr(); plNetLinkingMgr();
plNetLinkingMgr(const plNetLinkingMgr &); plNetLinkingMgr(const plNetLinkingMgr &) { }
~plNetLinkingMgr();
enum Cmds enum Cmds
{ {

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

@ -1053,6 +1053,8 @@ struct ScoreGetScoresTrans : NetAuthTrans {
void * param void * param
); );
~ScoreGetScoresTrans();
bool Send (); bool Send ();
void Post (); void Post ();
bool Recv ( bool Recv (
@ -4649,6 +4651,11 @@ ScoreGetScoresTrans::ScoreGetScoresTrans (
StrCopy(m_gameName, gameName, arrsize(m_gameName)); StrCopy(m_gameName, gameName, arrsize(m_gameName));
} }
//============================================================================
ScoreGetScoresTrans::~ScoreGetScoresTrans () {
delete[] m_scores;
}
//============================================================================ //============================================================================
bool ScoreGetScoresTrans::Send () { bool ScoreGetScoresTrans::Send () {
if (!AcquireConn()) if (!AcquireConn())

1
Sources/Plasma/PubUtilLib/plPipeline/plBinkPlayer.h

@ -58,6 +58,7 @@ class plBinkPlayer
public: public:
plBinkPlayer() : fFileName(nil) { } plBinkPlayer() : fFileName(nil) { }
~plBinkPlayer() { delete [] fFileName; }
static bool Init( hsWindowHndl hWnd) { return true; } static bool Init( hsWindowHndl hWnd) { return true; }
static bool DeInit() { return true; } static bool DeInit() { return true; }

Loading…
Cancel
Save