forked from github/server
falscher befehl ge-free'd, crash
This commit is contained in:
parent
b46efa76d4
commit
a8ed2663ef
|
@ -1054,7 +1054,7 @@ split_unit(region * r, unit *u)
|
||||||
set_string(&u2->display, u->display);
|
set_string(&u2->display, u->display);
|
||||||
set_order(&u2->thisorder, parse_order(keywords[K_WAIT], u->faction->locale));
|
set_order(&u2->thisorder, parse_order(keywords[K_WAIT], u->faction->locale));
|
||||||
set_order(&u2->lastorder, u2->thisorder);
|
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);
|
transfermen(u, u2, newsize);
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,7 @@ write_order(const order * cmd, const struct locale * lang, char * buffer, size_t
|
||||||
buffer[0]=0;
|
buffer[0]=0;
|
||||||
} else {
|
} else {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
char * s = cmd->_str;
|
const char * s = cmd->_str;
|
||||||
assert(findkeyword(parse_token(&s), lang)==cmd->_keyword);
|
assert(findkeyword(parse_token(&s), lang)==cmd->_keyword);
|
||||||
#endif
|
#endif
|
||||||
strncpy(buffer, cmd->_str, size);
|
strncpy(buffer, cmd->_str, size);
|
||||||
|
|
|
@ -28,7 +28,8 @@
|
||||||
static void
|
static void
|
||||||
free_script(attrib * a) {
|
free_script(attrib * a) {
|
||||||
if (a->data.v!=NULL) {
|
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) {
|
if (a == NULL) {
|
||||||
a = a_add(ap, a_new(&at_script));
|
a = a_add(ap, a_new(&at_script));
|
||||||
} else if (a->data.v!=NULL) {
|
} 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;
|
a->data.v = fptr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue