am_close: Close an Automerge document

View source: R/document.R

am_closeR Documentation

Close an Automerge document

Description

Explicitly frees the resources associated with an Automerge document. After calling this function, the document becomes invalid and should not be used.

Usage

am_close(doc)

Arguments

doc

An Automerge document (created with am_create() or am_load())

Details

This function is useful when you need deterministic cleanup rather than waiting for garbage collection. It is safe to call on a document that has already been closed.

Value

NULL (invisibly)

Examples

doc <- am_create()
am_put(doc, AM_ROOT, "key", "value")

# Explicitly free resources
am_close(doc)

# Document is now invalid - do not use after closing


automerge documentation built on Feb. 5, 2026, 5:08 p.m.