My driver crashes occasionally
It always with the log like
FATAL: Object 0xaa85cd8 /item/tool/budai#1471 ref count 0, but not destructed (from free_svalue).
or
FATAL: Object 0x7f234b58 /clone/money/gold#32143 ref count 0, but not destructed (from free_svalue)
.
These objects(/item/tool/budai and /clone/money/gold) inherits by /feature/combined.c
// combined_item.c
#include <dbase.h>
#include <name.h>
inherit F_CLEAN_UP;
inherit F_DBASE;
inherit F_MOVE;
inherit F_NAME;
static int amount;
void setup()
{
}
int query_amount() { return amount; }
private void destruct_me() { destruct(this_object()); }
void set_amount(int v)
{
if( v < 0 ) error("combine:set_amount less than 1.\n");
if( v==0 ) {
destruct(this_object());
return;
}
amount = v;
set_weight(v * (int)query("base_weight"));
}
void add_amount(int v) { set_amount(amount + v); }
string short()
{
return chinese_number(query_amount()) + query("base_unit")
+ ::short();
}
varargs int move(mixed dest, int silent)
{
object env, *inv;
int i, total;
string file;
if( ::move(dest, silent) ) {
if( living(env = environment()) ) {
file = base_name(this_object());
inv = all_inventory(env);
total = (int)query_amount();
for(i=0; i<sizeof(inv); i++) {
if( inv[i]==this_object() ) continue;
if( base_name(inv[i])==file ) {
total +=
(int)inv[i]->query_amount();
destruct(inv[i]);
}
}
set_amount(total);
}
return 1;
}
}
Please help me find the crash reason, thanks.