Skip to content

Commit 24cebba

Browse files
author
Cruz Monrreal
authored
Merge pull request #7016 from mikaleppanen/async_dns_corr
Corrected asynchronous DNS functionality
2 parents 19fb804 + d648bf8 commit 24cebba

File tree

4 files changed

+120
-72
lines changed

4 files changed

+120
-72
lines changed

features/FEATURE_LWIP/lwip-interface/LWIPStack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ void LWIP::tcpip_thread_callback(void *ptr)
209209

210210
nsapi_error_t LWIP::call_in(int delay, mbed::Callback<void()> func)
211211
{
212-
lwip_callback *cb = new lwip_callback;
212+
lwip_callback *cb = new (std::nothrow) lwip_callback;
213213
if (!cb) {
214214
return NSAPI_ERROR_NO_MEMORY;
215215
}

features/netsocket/NetworkStack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ nsapi_error_t NetworkStack::getsockopt(void *handle, int level, int optname, voi
114114

115115
nsapi_error_t NetworkStack::call_in(int delay, mbed::Callback<void()> func)
116116
{
117-
events::EventQueue *event_queue = mbed::mbed_event_queue();
117+
static events::EventQueue *event_queue = mbed::mbed_event_queue();
118118

119119
if (!event_queue) {
120120
return NSAPI_ERROR_NO_MEMORY;

0 commit comments

Comments
 (0)