summaryrefslogtreecommitdiff
path: root/src/player_relations.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-03-10 12:23:50 -0600
committerIra Rice <irarice@gmail.com>2009-03-10 12:50:39 -0600
commitcabb9735f2e31b9f1f64b2496e1775d54861da36 (patch)
tree6772eda38f08a77af7717c8f4747aab77061cfcf /src/player_relations.cpp
parent75fc8e62d25ff1d39408588f76d95df4a9a7e663 (diff)
downloadmana-client-cabb9735f2e31b9f1f64b2496e1775d54861da36.tar.gz
mana-client-cabb9735f2e31b9f1f64b2496e1775d54861da36.tar.bz2
mana-client-cabb9735f2e31b9f1f64b2496e1775d54861da36.tar.xz
mana-client-cabb9735f2e31b9f1f64b2496e1775d54861da36.zip
Fix some mem leaks
Diffstat (limited to 'src/player_relations.cpp')
-rw-r--r--src/player_relations.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/player_relations.cpp b/src/player_relations.cpp
index 65219626..1c1ba669 100644
--- a/src/player_relations.cpp
+++ b/src/player_relations.cpp
@@ -29,8 +29,6 @@
#include "player.h"
#include "player_relations.h"
-#include "utils/dtor.h"
-
#define PLAYER_IGNORE_STRATEGY_NOP "nop"
#define PLAYER_IGNORE_STRATEGY_EMOTE0 "emote0"
#define DEFAULT_IGNORE_STRATEGY PLAYER_IGNORE_STRATEGY_EMOTE0
@@ -40,6 +38,7 @@
#define IGNORE_EMOTE_TIME 100
+
// (De)serialisation class
class PlayerConfSerialiser : public ConfigurationListManager<std::pair<std::string, PlayerRelation *>,
std::map<std::string, PlayerRelation *> *>
@@ -94,11 +93,6 @@ PlayerRelationsManager::PlayerRelationsManager() :
{
}
-PlayerRelationsManager::~PlayerRelationsManager()
-{
- delete_all(mIgnoreStrategies);
-}
-
void PlayerRelationsManager::clear()
{
std::vector<std::string> *names = getPlayers();
@@ -352,22 +346,24 @@ private:
+static std::vector<PlayerIgnoreStrategy *> player_ignore_strategies;
+
std::vector<PlayerIgnoreStrategy *> *
PlayerRelationsManager::getPlayerIgnoreStrategies()
{
- if (mIgnoreStrategies.size() == 0) {
+ if (player_ignore_strategies.size() == 0) {
// not initialised yet?
- mIgnoreStrategies.push_back(new PIS_emote(FIRST_IGNORE_EMOTE,
+ player_ignore_strategies.push_back(new PIS_emote(FIRST_IGNORE_EMOTE,
"floating '...' bubble",
PLAYER_IGNORE_STRATEGY_EMOTE0));
- mIgnoreStrategies.push_back(new PIS_emote(FIRST_IGNORE_EMOTE + 1,
+ player_ignore_strategies.push_back(new PIS_emote(FIRST_IGNORE_EMOTE + 1,
"floating bubble",
"emote1"));
- mIgnoreStrategies.push_back(new PIS_nothing());
- mIgnoreStrategies.push_back(new PIS_dotdotdot());
- mIgnoreStrategies.push_back(new PIS_blinkname());
+ player_ignore_strategies.push_back(new PIS_nothing());
+ player_ignore_strategies.push_back(new PIS_dotdotdot());
+ player_ignore_strategies.push_back(new PIS_blinkname());
}
- return &mIgnoreStrategies;
+ return &player_ignore_strategies;
}