summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-28 15:19:28 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-28 15:19:28 +0300
commit594452c2495b2bc3e376a4b927f5992f9fc8b5db (patch)
tree665b32819c5f30669992f4f2b6d7190f329c1abf
parent974af7e3663c5f72091f8afd91e4ed732c42b20c (diff)
downloadevol-hercules-594452c2495b2bc3e376a4b927f5992f9fc8b5db.tar.gz
evol-hercules-594452c2495b2bc3e376a4b927f5992f9fc8b5db.tar.bz2
evol-hercules-594452c2495b2bc3e376a4b927f5992f9fc8b5db.tar.xz
evol-hercules-594452c2495b2bc3e376a4b927f5992f9fc8b5db.zip
fix default map name memory leak on exit.
-rw-r--r--src/char/init.c1
-rw-r--r--src/common/init.c6
-rw-r--r--src/common/init.h1
-rw-r--r--src/map/init.c1
4 files changed, 9 insertions, 0 deletions
diff --git a/src/char/init.c b/src/char/init.c
index 6e3ed0f..87b952b 100644
--- a/src/char/init.c
+++ b/src/char/init.c
@@ -88,4 +88,5 @@ HPExport void server_online (void)
HPExport void plugin_final (void)
{
+ commonClean();
}
diff --git a/src/common/init.c b/src/common/init.c
index 9b70e50..07bb936 100644
--- a/src/common/init.c
+++ b/src/common/init.c
@@ -36,3 +36,9 @@ void setDefaultMap(void)
mapindex->default_x = 80;
mapindex->default_y = 109;
}
+
+void commonClean(void)
+{
+ aFree(mapindex->default_map);
+ mapindex->default_map = NULL;
+}
diff --git a/src/common/init.h b/src/common/init.h
index bd86f5b..41f844c 100644
--- a/src/common/init.h
+++ b/src/common/init.h
@@ -6,5 +6,6 @@
void interfaces_init_common(void);
void setDefaultMap(void);
+void commonClean(void);
#endif // EVOL_COMMON_INTERFACES
diff --git a/src/map/init.c b/src/map/init.c
index 0b38ed7..170839a 100644
--- a/src/map/init.c
+++ b/src/map/init.c
@@ -218,4 +218,5 @@ HPExport void server_online (void)
HPExport void plugin_final (void)
{
do_final_langs();
+ commonClean();
}