diff --git a/src/common/gamecode/randenc.c b/src/common/gamecode/randenc.c index e62668abd..0bc5c2883 100644 --- a/src/common/gamecode/randenc.c +++ b/src/common/gamecode/randenc.c @@ -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); } diff --git a/src/common/kernel/order.c b/src/common/kernel/order.c index 3eab3351e..56d34bd9a 100644 --- a/src/common/kernel/order.c +++ b/src/common/kernel/order.c @@ -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); diff --git a/src/eressea/lua/script.cpp b/src/eressea/lua/script.cpp index a82725f75..a719532b3 100644 --- a/src/eressea/lua/script.cpp +++ b/src/eressea/lua/script.cpp @@ -28,7 +28,8 @@ static void free_script(attrib * a) { if (a->data.v!=NULL) { - delete a->data.v; + luabind::functor * f = (luabind::functor *)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 * f = (luabind::functor *)a->data.v; + delete f; } a->data.v = fptr; }