From 575b83e553b1b02a05a6cf9732d6b761b522cd74 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 17 Dec 2014 20:24:43 +0300 Subject: Remove plugin data in mob_data destruction. --- src/map/unit.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/map/unit.c b/src/map/unit.c index 0924e6cf2..e23eb42ac 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -2720,6 +2720,7 @@ int unit_free(struct block_list *bl, clr_type clrtype) { } case BL_MOB: { + unsigned int k; struct mob_data *md = (struct mob_data*)bl; if( md->spawn_timer != INVALID_TIMER ) { @@ -2774,6 +2775,15 @@ int unit_free(struct block_list *bl, clr_type clrtype) { mob->clone_delete(md); if( md->tomb_nid ) mob->mvptomb_destroy(md); + + for (k = 0; k < md->hdatac; k++) { + if( md->hdata[k]->flag.free ) { + aFree(md->hdata[k]->data); + } + aFree(md->hdata[k]); + } + if (md->hdata) + aFree(md->hdata); break; } case BL_HOM: -- cgit v1.2.3-70-g09d2