* Fixed missing iterator destruction in the map_foreach* functions (followup to r12684).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12686 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
FlavioJS 2008-05-02 21:22:20 +00:00
parent 7992f84a27
commit acde528ec5
2 changed files with 6 additions and 2 deletions

View File

@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2008/05/02 2008/05/02
* Fixed missing iterator destruction in the map_foreach* functions (followup to r12684).
* Added backward compatible handling of PACKETVER 8 and 9. (followup to r12539) * Added backward compatible handling of PACKETVER 8 and 9. (followup to r12539)
* Changes to map_foreach* functions: [FlavioJS] * Changes to map_foreach* functions: [FlavioJS]
- removed the unecessary use of va_copy in map_foreachpc - removed the unecessary use of va_copy in map_foreachpc

View File

@ -1746,7 +1746,7 @@ void map_foreachpc(int (*func)(struct map_session_data* sd, va_list args), ...)
DBIterator* iter; DBIterator* iter;
struct map_session_data* sd; struct map_session_data* sd;
iter = pc_db->iterator(pc_db); iter = db_iterator(pc_db);
for( sd = (struct map_session_data*)iter->first(iter,NULL); iter->exists(iter); sd = (struct map_session_data*)iter->next(iter,NULL) ) for( sd = (struct map_session_data*)iter->first(iter,NULL); iter->exists(iter); sd = (struct map_session_data*)iter->next(iter,NULL) )
{ {
va_list args; va_list args;
@ -1758,7 +1758,7 @@ void map_foreachpc(int (*func)(struct map_session_data* sd, va_list args), ...)
if( ret == -1 ) if( ret == -1 )
break;// stop iterating break;// stop iterating
} }
iter->destroy(iter); dbi_destroy(iter);
} }
/// Applies func to all the mobs in the db. /// Applies func to all the mobs in the db.
@ -1780,6 +1780,7 @@ void map_foreachmob(int (*func)(struct mob_data* md, va_list args), ...)
if( ret == -1 ) if( ret == -1 )
break;// stop iterating break;// stop iterating
} }
dbi_destroy(iter);
} }
/// Applies func to all the npcs in the db. /// Applies func to all the npcs in the db.
@ -1805,6 +1806,7 @@ void map_foreachnpc(int (*func)(struct npc_data* nd, va_list args), ...)
break;// stop iterating break;// stop iterating
} }
} }
dbi_destroy(iter);
} }
/// Applies func to everything in the db. /// Applies func to everything in the db.
@ -1826,6 +1828,7 @@ void map_foreachiddb(int (*func)(struct block_list* bl, va_list args), ...)
if( ret == -1 ) if( ret == -1 )
break;// stop iterating break;// stop iterating
} }
dbi_destroy(iter);
} }
/// Iterator. /// Iterator.