mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-23 08:45:22 +03:00
replace new
by new (std::nothrow)
, remove arduino_new
This commit is contained in:
@ -175,7 +175,10 @@ bool SSDPClass::begin() {
|
||||
|
||||
assert(NULL == _server);
|
||||
|
||||
_server = new UdpContext;
|
||||
_server = new (std::nothrow) UdpContext;
|
||||
if (_server == nullptr) {
|
||||
return false;
|
||||
}
|
||||
_server->ref();
|
||||
|
||||
IPAddress local = WiFi.localIP();
|
||||
@ -508,7 +511,9 @@ void SSDPClass::_onTimerStatic(SSDPClass* self) {
|
||||
|
||||
void SSDPClass::_startTimer() {
|
||||
_stopTimer();
|
||||
_timer = new SSDPTimer();
|
||||
_timer = new (std::nothrow) SSDPTimer();
|
||||
if (_timer == nullptr)
|
||||
return;
|
||||
ETSTimer* tm = &(_timer->timer);
|
||||
const int interval = 1000;
|
||||
os_timer_disarm(tm);
|
||||
|
Reference in New Issue
Block a user