onOpModeStop

fun onOpModeStop(block: () -> Unit)

Runs block every time the cached object is discarded (for example when an OpMode stops). Use this to invalidate state that mirrors the hardware, such as write caches.