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