mirror of
				https://github.com/esp8266/Arduino.git
				synced 2025-10-31 15:50:55 +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(){ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user