forked from github/server
memory leaks
This commit is contained in:
parent
b59489466d
commit
3460cf5b82
2 changed files with 25 additions and 14 deletions
|
@ -697,20 +697,28 @@ ffindhash(int no)
|
|||
void
|
||||
stripfaction (faction * f)
|
||||
{
|
||||
/* TODO: inhalt auch löschen */
|
||||
if (f->msgs) free(f->msgs);
|
||||
if (f->battles) free(f->battles);
|
||||
/* TODO: inhalt auch löschen */
|
||||
if (f->msgs) free_messagelist(f->msgs);
|
||||
while (f->battles) {
|
||||
struct bmsg * b = f->battles;
|
||||
f->battles = b->next;
|
||||
free_messagelist(b->msgs);
|
||||
}
|
||||
|
||||
/* TODO: free msgs */
|
||||
freelist(f->allies);
|
||||
free(f->email);
|
||||
free(f->banner);
|
||||
free(f->passw);
|
||||
free(f->override);
|
||||
free(f->name);
|
||||
while (f->attribs) a_remove (&f->attribs, f->attribs);
|
||||
freelist(f->ursprung);
|
||||
funhash(f);
|
||||
freelist(f->allies);
|
||||
|
||||
free(f->email);
|
||||
free(f->banner);
|
||||
free(f->passw);
|
||||
free(f->override);
|
||||
free(f->name);
|
||||
|
||||
while (f->attribs) a_remove (&f->attribs, f->attribs);
|
||||
|
||||
i_freeall(f->items);
|
||||
|
||||
freelist(f->ursprung);
|
||||
funhash(f);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -104,7 +104,7 @@
|
|||
#include <ctime>
|
||||
#include <clocale>
|
||||
|
||||
#ifdef USE_DMALLOC
|
||||
#if defined(USE_DMALLOC)
|
||||
# define CLEANUP_CODE
|
||||
#endif
|
||||
|
||||
|
@ -372,6 +372,9 @@ process_orders()
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifndef CLEANUP_CODE
|
||||
# define CLEANUP_CODE
|
||||
#endif
|
||||
#ifdef CLEANUP_CODE
|
||||
static void
|
||||
game_done(void)
|
||||
|
|
Loading…
Reference in a new issue