From 594452c2495b2bc3e376a4b927f5992f9fc8b5db Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 28 Feb 2015 15:19:28 +0300 Subject: fix default map name memory leak on exit. --- src/char/init.c | 1 + src/common/init.c | 6 ++++++ src/common/init.h | 1 + src/map/init.c | 1 + 4 files changed, 9 insertions(+) (limited to 'src') 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(); } -- cgit v1.2.3-70-g09d2