summaryrefslogtreecommitdiff
path: root/src/map/itemdb.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-22 12:15:49 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-22 12:15:49 +0000
commitde7175c5bc24b6e8f3b87540ae93f40a75df2df2 (patch)
tree4517d2916188504401ad86868e641edb35b40617 /src/map/itemdb.c
parentd0565d61b91c9784717e756c72b871099175408b (diff)
downloadhercules-de7175c5bc24b6e8f3b87540ae93f40a75df2df2.tar.gz
hercules-de7175c5bc24b6e8f3b87540ae93f40a75df2df2.tar.bz2
hercules-de7175c5bc24b6e8f3b87540ae93f40a75df2df2.tar.xz
hercules-de7175c5bc24b6e8f3b87540ae93f40a75df2df2.zip
* WARNING: New scripting system contains memory leak
TODO: Free all scripts using script_free_code() instead of old methods. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6690 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r--src/map/itemdb.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 4f6079f3a..603f20849 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -862,7 +862,7 @@ static int itemdb_read_sqldb(void)
// ----------
if (id->script)
- aFree(id->script);
+ script_free_code(id->script);
if (sql_row[19] != NULL) {
if (sql_row[19][0] == '{')
id->script = parse_script((unsigned char *) sql_row[19], 0);
@@ -873,7 +873,7 @@ static int itemdb_read_sqldb(void)
} else id->script = NULL;
if (id->equip_script)
- aFree(id->equip_script);
+ script_free_code(id->equip_script);
if (sql_row[20] != NULL) {
if (sql_row[20][0] == '{')
id->equip_script = parse_script((unsigned char *) sql_row[20], 0);
@@ -884,7 +884,7 @@ static int itemdb_read_sqldb(void)
} else id->equip_script = NULL;
if (id->unequip_script)
- aFree(id->unequip_script);
+ script_free_code(id->unequip_script);
if (sql_row[21] != NULL) {
if (sql_row[21][0] == '{')
id->unequip_script = parse_script((unsigned char *) sql_row[21], 0);
@@ -1030,7 +1030,7 @@ static int itemdb_readdb(void)
id->sex = itemdb_gendercheck(id); //Apply gender filtering.
if (id->script) {
- aFree(id->script);
+ script_free_code(id->script);
id->script=NULL;
}
if (id->equip_script) {
@@ -1130,17 +1130,17 @@ static int itemdb_final_sub (DBKey key,void *data,va_list ap)
flag = va_arg(ap, int);
if (id->script)
{
- aFree(id->script);
+ script_free_code(id->script);
id->script = NULL;
}
if (id->equip_script)
{
- aFree(id->equip_script);
+ script_free_code(id->equip_script);
id->equip_script = NULL;
}
if (id->unequip_script)
{
- aFree(id->unequip_script);
+ script_free_code(id->unequip_script);
id->unequip_script = NULL;
}
// Whether to clear the item data (exception: do not clear the dummy item data
@@ -1162,11 +1162,11 @@ void do_final_itemdb(void)
item_db->destroy(item_db, itemdb_final_sub, 1);
if (dummy_item) {
if (dummy_item->script)
- aFree(dummy_item->script);
+ script_free_code(dummy_item->script);
if (dummy_item->equip_script)
- aFree(dummy_item->equip_script);
+ script_free_code(dummy_item->equip_script);
if (dummy_item->unequip_script)
- aFree(dummy_item->unequip_script);
+ script_free_code(dummy_item->unequip_script);
aFree(dummy_item);
dummy_item = NULL;
}