Method: Oj::Doc#close

Defined in:
ext/oj/fast.c

#closeObject

Closes an open document. No further calls to the document will be valid after closing.

Examples:

doc = Oj::Doc.open('[1,2,3]')
doc.size()  #=> 4
doc.close()


1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
# File 'ext/oj/fast.c', line 1622

static VALUE doc_close(VALUE self) {
    Doc doc = self_doc(self);

    rb_gc_unregister_address(&doc->self);
    DATA_PTR(doc->self) = NULL;
    if (0 != doc) {
        doc_free(doc);
    }
    return Qnil;
}