deinitialize
Deinitializes IDV SDK and releases the native models it loaded. Must be called on a background thread. If IDV UI components are still processing camera images, this call blocks until that processing finishes.
Deinitialization is optional. IDV SDK keeps its native models in process-scoped memory that the operating system reclaims automatically when the process is terminated, so this call is not required for correctness and is not needed to avoid memory leaks. Its only purpose is to release that memory footprint earlier. Because reloading the models on the next initialize is expensive, deinitialize sparingly: at most once, at a quiescent point when leaving the flow - never within the lifecycle of individual Android components (onDestroy(), configuration changes such as screen rotation, or background-to-foreground transitions), which causes repeated, costly deinitialize / initialize cycles. When in doubt, skip deinitialization. After deinitializing, call initialize again before using any IDV SDK component.
Thread-safety: as with initialize, deinitialize must not run concurrently with initialize, and the if (DotSdk.isInitialized()) DotSdk.deinitialize() guard must be serialized behind a single owner.
Throws
if IDV SDK is not initialized.