    /*
     *  call-seq:
     *     dir.close() -> nil
     *
     *  It is a good idea to close a directory when you have finished using it.
     *  Although the garbage collector will currently handle this for you, this
     *  behaviour may change in future.
     */
    static VALUE
    frt_dir_close(VALUE self)
    {
        Store *store = DATA_PTR(self);
        int ref_cnt = FIX2INT(rb_ivar_get(self, id_ref_cnt)) - 1;
        rb_ivar_set(self, id_ref_cnt, INT2FIX(ref_cnt));
        if (ref_cnt < 0) {
            Frt_Unwrap_Struct(self);
            object_del(store);
            frt_unwrap_locks(store);
            store_deref(store);
        }
        return Qnil;
    }