diff options
author | Huynh Tran <nthuynh75@gmail.com> | 2005-06-29 10:28:36 +0000 |
---|---|---|
committer | Huynh Tran <nthuynh75@gmail.com> | 2005-06-29 10:28:36 +0000 |
commit | a5aee1322f498537f8de83123099bbfcb2e3a969 (patch) | |
tree | 979fa915c3fe5af122bb566fcca4850c63a9f311 /src/account.cpp | |
parent | 666447da2b65d55bc60ded978dfa92b40f9e3c24 (diff) | |
download | manaserv-a5aee1322f498537f8de83123099bbfcb2e3a969.tar.gz manaserv-a5aee1322f498537f8de83123099bbfcb2e3a969.tar.bz2 manaserv-a5aee1322f498537f8de83123099bbfcb2e3a969.tar.xz manaserv-a5aee1322f498537f8de83123099bbfcb2e3a969.zip |
Fixed memory leak and set conditional stats updates.
Diffstat (limited to 'src/account.cpp')
-rw-r--r-- | src/account.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/account.cpp b/src/account.cpp index ed2c358e..97b723a0 100644 --- a/src/account.cpp +++ b/src/account.cpp @@ -70,18 +70,15 @@ Account::Account(const std::string& name, Account::~Account(void) throw() { - // we do not delete the Beings here because Storage keeps - // a list of Beings as well and the destructor of Storage - // takes care about it. - - /* - *for (Beings::iterator it = mCharacters.begin(); - * it != mCharacters.end(); - * ++it) - *{ - * delete (*it); - *} - */ + for (Beings::iterator it = mCharacters.begin(); + it != mCharacters.end(); + ++it) + { + if (*it != 0) { + delete (*it); + *it = 0; + } + } } |