--- deliantra/server/server/cfperl.xs 2006/08/28 14:05:24 1.20 +++ deliantra/server/server/cfperl.xs 2006/08/28 15:48:13 1.21 @@ -317,14 +317,24 @@ { //if (self) fprintf (stderr, "free_ob_self %p %s (%p,%p)\n", this, ((object *)this)->name, self, cb);//D - if (self) SvREFCNT_dec (self); - if (cb) SvREFCNT_dec (cb); + if (self) + { + hv_clear ((HV *)SvRV ((SV *)self)); + sv_unmagic (SvRV ((SV *)self), PERL_MAGIC_ext); + SvREFCNT_dec (self); + } - if (attach) free_string (attach); + if (cb) + { + SvREFCNT_dec (cb); + cb = 0; + } - self = 0; - cb = 0; - attach = 0; + if (attach) + { + free_string (attach); + attach = 0; + } } void attachable_base::optimise ()