--- deliantra/server/include/cfperl.h 2007/08/01 20:07:06 1.85 +++ deliantra/server/include/cfperl.h 2007/08/06 10:54:12 1.86 @@ -156,7 +156,7 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// INTERFACE_CLASS (attachable) -struct attachable +struct attachable : refcnt_base { static MGVTBL vtbl; @@ -167,14 +167,9 @@ F_DESTROYED = 0x01, F_DEBUG_TRACE = 0x02, }; - - // object is delete'd after the refcount reaches 0 int ACC (RW, flags); - mutable int ACC (RW, refcnt); - - MTH void refcnt_inc () const { ++refcnt; } - MTH void refcnt_dec () const { --refcnt; } + // object is delete'd after the refcount reaches 0 MTH int refcnt_cnt () const; // check wether the object has died and destroy MTH void refcnt_chk () { if (expect_false (refcnt <= 0)) do_check (); } @@ -203,12 +198,12 @@ void optimise (); // possibly save some memory by destroying unneeded data attachable () - : flags (0), refcnt (0), self (0), cb (0), attach (0) + : flags (0), self (0), cb (0), attach (0) { } attachable (const attachable &src) - : flags (0), refcnt (0), self (0), cb (0), attach (src.attach) + : flags (0), self (0), cb (0), attach (src.attach) { }