Kernstra.destroy()
Tear down the SDK and free its resources. Destroy your viewers and close your documents first (each viewer terminates its render worker): with a document still open it throws INVALID_STATE rather than free them from under it.
After an ENGINE_FAILED fault it tears down whatever is open — that is the recovery — and a document closed after it is already released, so its close() does nothing. destroy() removes the onLicenseChange subscriptions, like every other SDK listener; Kernstra.events subscriptions are kept across it.
static methodLifecyclesince 1.0.0
Signature
static destroy(): void
Returns
void
Throws
INVALID_STATE— a document is still open.
Example
TypeScript
viewer.destroy(); await doc.close(); Kernstra.destroy();