summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-07-09 16:27:31 +0300
committerAndrei Karas <akaras@inbox.ru>2011-07-09 16:27:31 +0300
commitc06debb4683c784f35093af8fc08ca142a58f5de (patch)
tree8073c846715379d7ee388b88a0cac33e6512df42 /src/net
parentc8a5af485ef256446c761409c9947a6ca521bc25 (diff)
downloadmanaplus-c06debb4683c784f35093af8fc08ca142a58f5de.tar.gz
manaplus-c06debb4683c784f35093af8fc08ca142a58f5de.tar.bz2
manaplus-c06debb4683c784f35093af8fc08ca142a58f5de.tar.xz
manaplus-c06debb4683c784f35093af8fc08ca142a58f5de.zip
Fix for party memory leak and crash.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/manaserv/partyhandler.cpp4
-rw-r--r--src/net/manaserv/partyhandler.h6
-rw-r--r--src/net/partyhandler.h2
-rw-r--r--src/net/tmwa/partyhandler.cpp5
-rw-r--r--src/net/tmwa/partyhandler.h2
5 files changed, 18 insertions, 1 deletions
diff --git a/src/net/manaserv/partyhandler.cpp b/src/net/manaserv/partyhandler.cpp
index 9a5f19678..0e6af4578 100644
--- a/src/net/manaserv/partyhandler.cpp
+++ b/src/net/manaserv/partyhandler.cpp
@@ -195,4 +195,8 @@ void PartyHandler::requestPartyMembers() const
//chatServerConnection->send(msg);
}
+void PartyHandler::clear()
+{
+}
+
} // namespace ManaServ
diff --git a/src/net/manaserv/partyhandler.h b/src/net/manaserv/partyhandler.h
index 7403d0e36..89924c962 100644
--- a/src/net/manaserv/partyhandler.h
+++ b/src/net/manaserv/partyhandler.h
@@ -76,7 +76,11 @@ public:
PartyShare getShareItems() const
{ return PARTY_SHARE_NO; }
- void setShareItems(PartyShare share A_UNUSED) {}
+ void setShareItems(PartyShare share A_UNUSED)
+ { }
+
+ void clear();
+
private:
Party *mParty;
};
diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h
index e33bac383..246987eb1 100644
--- a/src/net/partyhandler.h
+++ b/src/net/partyhandler.h
@@ -73,6 +73,8 @@ class PartyHandler
virtual void setShareItems(PartyShare share) = 0;
+ virtual void clear() = 0;
+
// virtual void options() = 0;
// virtual void message() = 0;
diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp
index f8e1e4de8..1526100f6 100644
--- a/src/net/tmwa/partyhandler.cpp
+++ b/src/net/tmwa/partyhandler.cpp
@@ -575,4 +575,9 @@ void PartyHandler::reload()
taParty = Party::getParty(1);
}
+void PartyHandler::clear()
+{
+ taParty = 0;
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/partyhandler.h b/src/net/tmwa/partyhandler.h
index 207bc5f26..d2b204a55 100644
--- a/src/net/tmwa/partyhandler.h
+++ b/src/net/tmwa/partyhandler.h
@@ -78,6 +78,8 @@ class PartyHandler : public MessageHandler, public Net::PartyHandler
void reload();
+ void clear();
+
private:
PartyShare mShareExp, mShareItems;
};