ldmud-3.4.1/doc/
ldmud-3.4.1/doc/efun.de/
ldmud-3.4.1/doc/efun/
ldmud-3.4.1/doc/man/
ldmud-3.4.1/doc/other/
ldmud-3.4.1/mud/
ldmud-3.4.1/mud/heaven7/
ldmud-3.4.1/mud/lp-245/
ldmud-3.4.1/mud/lp-245/banish/
ldmud-3.4.1/mud/lp-245/doc/
ldmud-3.4.1/mud/lp-245/doc/examples/
ldmud-3.4.1/mud/lp-245/doc/sefun/
ldmud-3.4.1/mud/lp-245/log/
ldmud-3.4.1/mud/lp-245/obj/Go/
ldmud-3.4.1/mud/lp-245/players/lars/
ldmud-3.4.1/mud/lp-245/room/death/
ldmud-3.4.1/mud/lp-245/room/maze1/
ldmud-3.4.1/mud/lp-245/room/sub/
ldmud-3.4.1/mud/lp-245/secure/
ldmud-3.4.1/mud/morgengrauen/
ldmud-3.4.1/mud/morgengrauen/lib/
ldmud-3.4.1/mud/sticklib/
ldmud-3.4.1/mud/sticklib/src/
ldmud-3.4.1/mudlib/uni-crasher/
ldmud-3.4.1/pkg/
ldmud-3.4.1/pkg/debugger/
ldmud-3.4.1/pkg/diff/
ldmud-3.4.1/pkg/misc/
ldmud-3.4.1/src/autoconf/
ldmud-3.4.1/src/hosts/
ldmud-3.4.1/src/hosts/GnuWin32/
ldmud-3.4.1/src/hosts/amiga/
ldmud-3.4.1/src/hosts/win32/
ldmud-3.4.1/src/ptmalloc/
ldmud-3.4.1/src/util/
ldmud-3.4.1/src/util/erq/
ldmud-3.4.1/src/util/indent/hosts/next/
ldmud-3.4.1/src/util/xerq/
ldmud-3.4.1/src/util/xerq/lpc/
ldmud-3.4.1/src/util/xerq/lpc/www/
ldmud-3.4.1/test/t-030925/
ldmud-3.4.1/test/t-040413/
ldmud-3.4.1/test/t-041124/
SYNOPSIS
        int <lfun> (int refcount)
        int <closure>(int ref, object ob)

DESCRIPTION
        The hook H_CLEAN_UP defines a lfun or a closure used to clean
        up an object. In older drivers this was hardwired to the lfun
        clean_up().

        The function is applied by the driver when an object hasn't been
        used for a long time, to give it a possibility to
        self-destruct. The refcount <ref> passed as argument will be 0 for
        clone objects, 1 for a simple loaded object, and greater when
        the object is cloned or inherited by some existing object.  It
        is recommended not to self_destruct the object when the
        reference count is greater than one.

        By convention, a refcount < 0 is used if some other object
        asks the called object to clean_up.

        If the function is a closure, the second argument <ob> is the
        object to clean up.

        If the hook specifies a non-existing lfun, or if the call
        returns 0, no further attempt to clean up this object will be done.

        Returning a non-zero value is only recommended when the reason
        why the object can't self-destruct is likely to vanish without
        the object being touched, that is, when no local function is
        called in it, (and in compat mode also when the object is not
        being moved around).

        A typical mud configuration defines the time to wait for
        clean_up() so long that you can assert reset() has been
        called since the object has been touched last time.

EXAMPLES
        A clone of /std/drink defines clean_up() to self-destruct if
        it is empty, not carried a living being and not touched for
        a long time.

        A room that inherits /std/room defines clean_up() to
        self-destruct if it is neither inherited nor used as a
        blueprint, is empty and was not entered for a long time.

HISTORY
        Before 3.2.1, the function was hardwired to the lfun clean_up().

SEE ALSO
        reset(A), heart_beat(A), call_out(E), destruct(E), remove(A),
        hooks(C)