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:43:02 -0600
commit75fc8e62d25ff1d39408588f76d95df4a9a7e663 (patch)
treebaea474d54281912dfec08d75319a4a09f4e03bd /src/player_relations.cpp
parent0540c611b48fd8dee14066b13755138192b7084b (diff)
downloadmana-client-75fc8e62d25ff1d39408588f76d95df4a9a7e663.tar.gz
mana-client-75fc8e62d25ff1d39408588f76d95df4a9a7e663.tar.bz2
mana-client-75fc8e62d25ff1d39408588f76d95df4a9a7e663.tar.xz
mana-client-75fc8e62d25ff1d39408588f76d95df4a9a7e663.zip
Fix some mem leaks
Diffstat (limited to 'src/player_relations.cpp')
-rw-r--r--src/player_relations.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/player_relations.cpp b/src/player_relations.cpp
index 1c1ba669..65219626 100644
--- a/src/player_relations.cpp
+++ b/src/player_relations.cpp
@@ -29,6 +29,8 @@
#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
@@ -38,7 +40,6 @@
#define IGNORE_EMOTE_TIME 100
-
// (De)serialisation class
class PlayerConfSerialiser : public ConfigurationListManager<std::pair<std::string, PlayerRelation *>,
std::map<std::string, PlayerRelation *> *>
@@ -93,6 +94,11 @@ PlayerRelationsManager::PlayerRelationsManager() :
{
}
+PlayerRelationsManager::~PlayerRelationsManager()
+{
+ delete_all(mIgnoreStrategies);
+}
+
void PlayerRelationsManager::clear()
{
std::vector<std::string> *names = getPlayers();
@@ -346,24 +352,22 @@ private:
-static std::vector<PlayerIgnoreStrategy *> player_ignore_strategies;
-
std::vector<PlayerIgnoreStrategy *> *
PlayerRelationsManager::getPlayerIgnoreStrategies()
{
- if (player_ignore_strategies.size() == 0) {
+ if (mIgnoreStrategies.size() == 0) {
// not initialised yet?
- player_ignore_strategies.push_back(new PIS_emote(FIRST_IGNORE_EMOTE,
+ mIgnoreStrategies.push_back(new PIS_emote(FIRST_IGNORE_EMOTE,
"floating '...' bubble",
PLAYER_IGNORE_STRATEGY_EMOTE0));
- player_ignore_strategies.push_back(new PIS_emote(FIRST_IGNORE_EMOTE + 1,
+ mIgnoreStrategies.push_back(new PIS_emote(FIRST_IGNORE_EMOTE + 1,
"floating bubble",
"emote1"));
- player_ignore_strategies.push_back(new PIS_nothing());
- player_ignore_strategies.push_back(new PIS_dotdotdot());
- player_ignore_strategies.push_back(new PIS_blinkname());
+ mIgnoreStrategies.push_back(new PIS_nothing());
+ mIgnoreStrategies.push_back(new PIS_dotdotdot());
+ mIgnoreStrategies.push_back(new PIS_blinkname());
}
- return &player_ignore_strategies;
+ return &mIgnoreStrategies;
}