close Function

@Synchronized open override fun close()

Releases the native memory held by this instance immediately instead of waiting for the garbage collector.

Closing is optional for the scan types: an unclosed instance is still released by the collector eventually. ImageWriter is the exception — a writer must be closed to finish rendering its output.

Idempotent: a second call is a no-op. After close, an otherwise-valid operation that needs this instance’s native state — whether the instance is the method receiver or an argument — throws ScanningSdkException. Do not close an instance while another thread is inside a call that uses it (the android.graphics.Bitmap.recycle model). Any instance returned by the SDK is owned by the caller and may be closed.

Top