Public API
releaseDocumentSurface
Close annotation on your surface before destroying its resources.
Use this when managing a rendering provider yourself. If you used
installPluginIntegration, its cleanup()
already releases the surface for you.
ink:releaseDocumentSurface(surface)
unregister() -- your registerRenderingView cleanup
-- Remove independent event subscriptions, then destroy the viewer.Arguments
| Name | Type | Meaning |
|---|---|---|
surface | surface table | The exact surface object you own. Never pass nil. |
Returns
No value (nil). Closure does not acknowledge a successful disk save.
Things to know
- Only the exact currently active surface matches. Another table with equal fields does not close it.
- It uses the normal save/close path, also closes book notes if open, and clears that surface selection.
- It does not unregister providers or remove listeners. Release first, while close listeners are still connected.
- During a navigation handoff, keep the landing surface alive. Do not release the session being transferred; the final viewer releases it on closure.
- A surface's
finish()must tolerate its viewer already being closed.
Event-only consumers do not need this method.