Fixed memleak hell during mapserver shutdown (if grf reading is used and the deallocation routine is actually called).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11439 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
d2e2f9924f
commit
74c5d717aa
@ -777,20 +777,26 @@ static int grfio_add(char* fname)
|
|||||||
// removes all entries
|
// removes all entries
|
||||||
void grfio_final(void)
|
void grfio_final(void)
|
||||||
{
|
{
|
||||||
if (filelist != NULL)
|
if (filelist != NULL) {
|
||||||
aFree(filelist);
|
int i;
|
||||||
|
for (i = 0; i < filelist_entrys; i++)
|
||||||
|
if (filelist[i].fnd != NULL)
|
||||||
|
aFree(filelist[i].fnd);
|
||||||
|
|
||||||
|
aFree(filelist);
|
||||||
|
filelist = NULL;
|
||||||
|
}
|
||||||
filelist_entrys = filelist_maxentry = 0;
|
filelist_entrys = filelist_maxentry = 0;
|
||||||
|
|
||||||
if (gentry_table != NULL) {
|
if (gentry_table != NULL) {
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < gentry_entrys; i++) {
|
for (i = 0; i < gentry_entrys; i++)
|
||||||
if (gentry_table[i] != NULL)
|
if (gentry_table[i] != NULL)
|
||||||
aFree(gentry_table[i]);
|
aFree(gentry_table[i]);
|
||||||
}
|
|
||||||
aFree(gentry_table);
|
aFree(gentry_table);
|
||||||
|
gentry_table = NULL;
|
||||||
}
|
}
|
||||||
gentry_table = NULL;
|
|
||||||
gentry_entrys = gentry_maxentry = 0;
|
gentry_entrys = gentry_maxentry = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3189,6 +3189,8 @@ void do_final(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mapindex_final();
|
mapindex_final();
|
||||||
|
if(enable_grf)
|
||||||
|
grfio_final();
|
||||||
|
|
||||||
id_db->destroy(id_db, NULL);
|
id_db->destroy(id_db, NULL);
|
||||||
pc_db->destroy(pc_db, NULL);
|
pc_db->destroy(pc_db, NULL);
|
||||||
|
@ -776,20 +776,26 @@ static int grfio_add(char* fname)
|
|||||||
// removes all entries
|
// removes all entries
|
||||||
void grfio_final(void)
|
void grfio_final(void)
|
||||||
{
|
{
|
||||||
if (filelist != NULL)
|
if (filelist != NULL) {
|
||||||
free(filelist);
|
int i;
|
||||||
|
for (i = 0; i < filelist_entrys; i++)
|
||||||
|
if (filelist[i].fnd != NULL)
|
||||||
|
free(filelist[i].fnd);
|
||||||
|
|
||||||
|
free(filelist);
|
||||||
|
filelist = NULL;
|
||||||
|
}
|
||||||
filelist_entrys = filelist_maxentry = 0;
|
filelist_entrys = filelist_maxentry = 0;
|
||||||
|
|
||||||
if (gentry_table != NULL) {
|
if (gentry_table != NULL) {
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < gentry_entrys; i++) {
|
for (i = 0; i < gentry_entrys; i++)
|
||||||
if (gentry_table[i] != NULL)
|
if (gentry_table[i] != NULL)
|
||||||
free(gentry_table[i]);
|
free(gentry_table[i]);
|
||||||
}
|
|
||||||
free(gentry_table);
|
free(gentry_table);
|
||||||
|
gentry_table = NULL;
|
||||||
}
|
}
|
||||||
gentry_table = NULL;
|
|
||||||
gentry_entrys = gentry_maxentry = 0;
|
gentry_entrys = gentry_maxentry = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user