diff --git a/src/core/instance/instance.cpp b/src/core/instance/instance.cpp index 133a872da..f9aa03765 100644 --- a/src/core/instance/instance.cpp +++ b/src/core/instance/instance.cpp @@ -430,10 +430,12 @@ void Instance::Finalize(void) mIsInitialized = false; #if OPENTHREAD_MTD || OPENTHREAD_FTD - IgnoreError(otThreadSetEnabled(this, false)); - IgnoreError(otIp6SetEnabled(this, false)); - IgnoreError(otLinkSetEnabled(this, false)); - +#if OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE + Get().SetEnabled(false); +#endif + Get().Stop(); + Get().Down(); + Get().SetEnabled(false); #if OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE Get().DestroyTemporaryKeys(); #endif