summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-17 17:35:10 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-19 19:17:57 +0300
commit2e76de4a5c6f51dab67b8ee41604d714e3cddd39 (patch)
tree1ce3efd00ef44ee84392677ad4a800e4d4341449 /src/map
parentedbe66e718bca90f1da015a6db3284d840ba19cb (diff)
downloadhercules-2e76de4a5c6f51dab67b8ee41604d714e3cddd39.tar.gz
hercules-2e76de4a5c6f51dab67b8ee41604d714e3cddd39.tar.bz2
hercules-2e76de4a5c6f51dab67b8ee41604d714e3cddd39.tar.xz
hercules-2e76de4a5c6f51dab67b8ee41604d714e3cddd39.zip
Remove plugin data in item_data destruction.
Diffstat (limited to 'src/map')
-rw-r--r--src/map/itemdb.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 545ce9ba0..9bb34f024 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -16,6 +16,7 @@
#include "mob.h" // MAX_MOB_DB
#include "pc.h" // W_MUSICAL, W_WHIP
#include "script.h" // item script processing
+#include "../common/HPM.h"
#include "../common/conf.h"
#include "../common/malloc.h"
#include "../common/nullpo.h"
@@ -2069,6 +2070,7 @@ bool itemdb_is_item_usable(struct item_data *item)
/// Destroys the item_data.
void destroy_item_data(struct item_data* self, int free_self)
{
+ int v;
if( self == NULL )
return;
// free scripts
@@ -2080,6 +2082,14 @@ void destroy_item_data(struct item_data* self, int free_self)
script->free_code(self->unequip_script);
if( self->combos )
aFree(self->combos);
+ for (v = 0; v < self->hdatac; v++ ) {
+ if (self->hdata[v]->flag.free ) {
+ aFree(self->hdata[v]->data);
+ }
+ aFree(self->hdata[v]);
+ }
+ if (self->hdata)
+ aFree(self->hdata);
#if defined(DEBUG)
// trash item
memset(self, 0xDD, sizeof(struct item_data));