mirror of
https://github.com/espressif/openthread.git
synced 2026-09-16 22:20:07 +00:00
remove delete calls (#906)
This commit is contained in:
committed by
Jonathan Hui
parent
266232e2a4
commit
8d55f4f823
@@ -39,7 +39,4 @@
|
||||
|
||||
inline void *operator new(size_t, void *p) throw() { return p; }
|
||||
|
||||
void OT_CDECL operator delete(void *, size_t) throw();
|
||||
void OT_CDECL operator delete(void *) throw();
|
||||
|
||||
#endif // NEW_HPP_
|
||||
|
||||
@@ -107,6 +107,8 @@ ThreadError Commissioner::Stop(void)
|
||||
|
||||
mTimer.Stop();
|
||||
|
||||
mNetif.GetDtls().Stop();
|
||||
|
||||
SendKeepAlive();
|
||||
|
||||
exit:
|
||||
|
||||
@@ -57,14 +57,6 @@ Dtls::Dtls(ThreadNetif &aNetif):
|
||||
mProvisioningUrl.Init();
|
||||
}
|
||||
|
||||
Dtls::~Dtls(void)
|
||||
{
|
||||
if (mStarted)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
ThreadError Dtls::Start(bool aClient, ReceiveHandler aReceiveHandler, SendHandler aSendHandler, void *aContext)
|
||||
{
|
||||
static const int ciphersuites[2] = {0xC0FF, 0}; // EC-JPAKE cipher suite
|
||||
@@ -136,12 +128,15 @@ ThreadError Dtls::Stop(void)
|
||||
|
||||
void Dtls::Close(void)
|
||||
{
|
||||
mStarted = false;
|
||||
mbedtls_ssl_free(&mSsl);
|
||||
mbedtls_ssl_config_free(&mConf);
|
||||
mbedtls_ctr_drbg_free(&mCtrDrbg);
|
||||
mbedtls_entropy_free(&mEntropy);
|
||||
mbedtls_ssl_cookie_free(&mCookieCtx);
|
||||
if (mStarted)
|
||||
{
|
||||
mStarted = false;
|
||||
mbedtls_ssl_free(&mSsl);
|
||||
mbedtls_ssl_config_free(&mConf);
|
||||
mbedtls_ctr_drbg_free(&mCtrDrbg);
|
||||
mbedtls_entropy_free(&mEntropy);
|
||||
mbedtls_ssl_cookie_free(&mCookieCtx);
|
||||
}
|
||||
}
|
||||
|
||||
bool Dtls::IsStarted(void)
|
||||
|
||||
@@ -69,12 +69,6 @@ public:
|
||||
*/
|
||||
Dtls(ThreadNetif &aNetif);
|
||||
|
||||
/**
|
||||
* This destructor cleans up the DTLS object.
|
||||
*
|
||||
*/
|
||||
~Dtls(void);
|
||||
|
||||
/**
|
||||
* This function pointer is called when data is received from the DTLS session.
|
||||
*
|
||||
|
||||
@@ -66,9 +66,6 @@ static otDEFINE_ALIGNED_VAR(sInstanceRaw, sizeof(otInstance), uint64_t);
|
||||
otInstance *sInstance = NULL;
|
||||
#endif
|
||||
|
||||
void OT_CDECL operator delete(void *, size_t) throw() { }
|
||||
void OT_CDECL operator delete(void *) throw() { }
|
||||
|
||||
otInstance::otInstance(void) :
|
||||
mReceiveIp6DatagramCallback(NULL),
|
||||
mReceiveIp6DatagramCallbackContext(NULL),
|
||||
@@ -1159,9 +1156,6 @@ void otInstanceFinalize(otInstance *aInstance)
|
||||
(void)otThreadStop(aInstance);
|
||||
(void)otInterfaceDown(aInstance);
|
||||
|
||||
// Free the otInstance structure
|
||||
delete aInstance;
|
||||
|
||||
#ifndef OPENTHREAD_MULTIPLE_INSTANCE
|
||||
sInstance = NULL;
|
||||
#endif
|
||||
|
||||
@@ -115,6 +115,11 @@ ThreadError ThreadNetif::Down(void)
|
||||
mMeshForwarder.Stop();
|
||||
mIp6.RemoveNetif(*this);
|
||||
mIsUp = false;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DTLS
|
||||
mDtls.Stop();
|
||||
#endif
|
||||
|
||||
return kThreadError_None;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user