Ein bischen aufraeumen am Schluss kann nicht wehtun. Nicht doll.

This commit is contained in:
Enno Rehling 2005-05-07 13:38:46 +00:00
parent d7cf8ccc6a
commit b4acb828d7
5 changed files with 53 additions and 27 deletions

View File

@ -8,7 +8,12 @@ if ! $(HAVE_LUA) {
} }
if ! $(DISTCC_HOSTS) { if ! $(DISTCC_HOSTS) {
} else { }
else {
DISTCC = 1 ;
}
if $(DISTCC) {
CC = distcc $(CC) ; CC = distcc $(CC) ;
C++ = distcc $(C++) ; C++ = distcc $(C++) ;
Echo Compiling with distcc ; Echo Compiling with distcc ;
@ -24,6 +29,7 @@ if ! $(CCACHE_DIR) {
if $(DMALLOC) { if $(DMALLOC) {
Echo Compiling with dmalloc ; Echo Compiling with dmalloc ;
CCFLAGS += -DUSE_DMALLOC ; CCFLAGS += -DUSE_DMALLOC ;
C++FLAGS += -DUSE_DMALLOC ;
LINKFLAGS += -ldmalloc ; LINKFLAGS += -ldmalloc ;
} }

View File

@ -350,6 +350,19 @@ cmistake(const unit * u, struct order *ord, int mno, int mtype)
extern unsigned int new_hashstring(const char* s); extern unsigned int new_hashstring(const char* s);
void
free_messagelist(message_list * msgs)
{
struct mlist ** mlistptr = &msgs->begin;
while (*mlistptr) {
struct mlist * ml = *mlistptr;
*mlistptr = ml->next;
msg_release(ml->msg);
free(ml);
}
free(msgs);
}
message * message *
add_message(message_list** pm, message * m) add_message(message_list** pm, message * m)
{ {

View File

@ -34,8 +34,9 @@ typedef struct message_list {
} * begin, **end; } * begin, **end;
} message_list; } message_list;
typedef struct messageclass extern void free_messagelist(message_list * msgs);
{
typedef struct messageclass {
struct messageclass * next; struct messageclass * next;
const char * name; const char * name;
} messageclass; } messageclass;

View File

@ -801,7 +801,25 @@ free_region(region * r)
if (last == r) last = NULL; if (last == r) last = NULL;
free(r->display); free(r->display);
if (r->land) freeland(r->land); if (r->land) freeland(r->land);
if (r->msgs) {
free_messagelist(r->msgs);
r->msgs = 0;
}
while (r->individual_messages) {
struct individual_message * msg = r->individual_messages;
r->individual_messages = msg->next;
free_messagelist(msg->msgs);
free(msg);
}
while (r->attribs) a_remove (&r->attribs, r->attribs); while (r->attribs) a_remove (&r->attribs, r->attribs);
while (r->resources) {
rawmaterial * res = r->resources;
r->resources = res->next;
free(res);
}
free(r); free(r);
} }

View File

@ -414,18 +414,6 @@ game_done(void)
region *r = regions; region *r = regions;
regions = r->next; regions = r->next;
if (r->msgs) {
message_list::mlist ** mlistptr = &r->msgs->begin;
while (*mlistptr) {
message_list::mlist * ml = *mlistptr;
*mlistptr = ml->next;
msg_release(ml->msg);
free(ml);
}
free(r->msgs);
r->msgs = 0;
}
while (r->units) { while (r->units) {
unit * u = r->units; unit * u = r->units;
r->units = u->next; r->units = u->next;