mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-23 08:45:22 +03:00
remove (std::nothrow) where nullptr case is not handled
remove legacy new management
This commit is contained in:
@ -106,9 +106,9 @@ void ArduinoOTAClass::setRebootOnSuccess(bool reboot){
|
||||
_rebootOnSuccess = reboot;
|
||||
}
|
||||
|
||||
bool ArduinoOTAClass::begin(bool useMDNS) {
|
||||
void ArduinoOTAClass::begin(bool useMDNS) {
|
||||
if (_initialized)
|
||||
return true;
|
||||
return;
|
||||
|
||||
_useMDNS = useMDNS;
|
||||
|
||||
@ -126,13 +126,11 @@ bool ArduinoOTAClass::begin(bool useMDNS) {
|
||||
_udp_ota = 0;
|
||||
}
|
||||
|
||||
_udp_ota = new (std::nothrow) UdpContext;
|
||||
if (_udp_ota == nullptr)
|
||||
return false;
|
||||
_udp_ota = new UdpContext;
|
||||
_udp_ota->ref();
|
||||
|
||||
if(!_udp_ota->listen(IP_ADDR_ANY, _port))
|
||||
return false;
|
||||
return;
|
||||
_udp_ota->onRx(std::bind(&ArduinoOTAClass::_onRx, this));
|
||||
|
||||
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_MDNS)
|
||||
@ -151,7 +149,6 @@ bool ArduinoOTAClass::begin(bool useMDNS) {
|
||||
#ifdef OTA_DEBUG
|
||||
OTA_DEBUG.printf("OTA server at: %s.local:%u\n", _hostname.c_str(), _port);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
int ArduinoOTAClass::parseInt(){
|
||||
|
@ -60,7 +60,7 @@ class ArduinoOTAClass
|
||||
void onProgress(THandlerFunction_Progress fn);
|
||||
|
||||
//Starts the ArduinoOTA service
|
||||
bool begin(bool useMDNS = true);
|
||||
void begin(bool useMDNS = true);
|
||||
|
||||
//Call this in loop() to run the service. Also calls MDNS.update() when begin() or begin(true) is used.
|
||||
void handle();
|
||||
|
Reference in New Issue
Block a user