close Function

@Synchronized open override fun close()

Finish rendering and release the writer’s native memory.

Must be called to produce a valid output file. Rendering errors propagate as ScanningSdkException; the native memory is released even when finishing fails. Idempotent: a second call is a no-op. Writing after close throws ScanningSdkException.

Closing a writer that never produced anything is also a no-op, and in particular is always safe after a failed write: if the output file could not be opened at all, there is nothing to finish, so close returns without raising a second error over the one write already reported. That makes the use { } form above correct even when the export fails.

Top