Learn R Programming

automerge (version 0.3.0)

am_close: 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)

Value

NULL (invisibly)

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.

Examples

Run this code
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

Run the code above in your browser using DataLab