falscher befehl ge-free'd, crash

This commit is contained in:
Enno Rehling 2004-06-26 09:28:39 +00:00
parent b46efa76d4
commit a8ed2663ef
3 changed files with 6 additions and 4 deletions

View File

@ -1054,7 +1054,7 @@ split_unit(region * r, unit *u)
set_string(&u2->display, u->display);
set_order(&u2->thisorder, parse_order(keywords[K_WAIT], u->faction->locale));
set_order(&u2->lastorder, u2->thisorder);
free_order(u->lastorder); /* parse_order & set_order have each increased the refcount */
free_order(u2->lastorder); /* parse_order & set_order have each increased the refcount */
transfermen(u, u2, newsize);
}

View File

@ -107,7 +107,7 @@ write_order(const order * cmd, const struct locale * lang, char * buffer, size_t
buffer[0]=0;
} else {
#ifndef NDEBUG
char * s = cmd->_str;
const char * s = cmd->_str;
assert(findkeyword(parse_token(&s), lang)==cmd->_keyword);
#endif
strncpy(buffer, cmd->_str, size);

View File

@ -28,7 +28,8 @@
static void
free_script(attrib * a) {
if (a->data.v!=NULL) {
delete a->data.v;
luabind::functor<void> * f = (luabind::functor<void> *)a->data.v;
delete f;
}
}
@ -57,7 +58,8 @@ setscript(struct attrib ** ap, void * fptr)
if (a == NULL) {
a = a_add(ap, a_new(&at_script));
} else if (a->data.v!=NULL) {
delete a->data.v;
luabind::functor<void> * f = (luabind::functor<void> *)a->data.v;
delete f;
}
a->data.v = fptr;
}