diff options
author | Handa Wang <7058128+superwhd@users.noreply.github.com> | 2024-03-12 23:55:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-12 08:55:12 -0700 |
commit | 81b310c8abcd48836d0e014862a8804fc34d9a4a (patch) | |
tree | 09875fd97230319aa0d342d08ed4d538c5b890e5 | |
parent | 3117caa881bbf36ddd111c56c35c8cde3af51791 (diff) | |
download | ot-br-posix-81b310c8abcd48836d0e014862a8804fc34d9a4a.tar.gz |
[ncp] clear handlers and callbacks in `NcpOpenThread::Deinit()` (#2220)
This is to avoid having stale/undesired handlers when calling
`NcpOpenThread::Init()`.
-rw-r--r-- | src/ncp/ncp_openthread.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ncp/ncp_openthread.cpp b/src/ncp/ncp_openthread.cpp index efd3e7f0..84a86014 100644 --- a/src/ncp/ncp_openthread.cpp +++ b/src/ncp/ncp_openthread.cpp @@ -296,6 +296,9 @@ void ControllerOpenThread::Deinit(void) otSysDeinit(); mInstance = nullptr; + + mThreadStateChangedCallbacks.clear(); + mResetHandlers.clear(); } void ControllerOpenThread::HandleStateChanged(otChangedFlags aFlags) |