LwIpIntfDev.end() check _started to prevent crash (#2304)
From @JAndrassy https://github.com/esp8266/Arduino/pull/9173
This commit is contained in:
parent
dd1c9095e8
commit
34f386a21b
1 changed files with 13 additions and 11 deletions
|
|
@ -427,18 +427,20 @@ bool LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu) {
|
|||
|
||||
template<class RawDev>
|
||||
void LwipIntfDev<RawDev>::end() {
|
||||
if (_intrPin < 0) {
|
||||
__removeEthernetPacketHandler(_phID);
|
||||
} else {
|
||||
detachInterrupt(_intrPin);
|
||||
__removeEthernetGPIO(_intrPin);
|
||||
if (_started) {
|
||||
if (_intrPin < 0) {
|
||||
__removeEthernetPacketHandler(_phID);
|
||||
} else {
|
||||
detachInterrupt(_intrPin);
|
||||
__removeEthernetGPIO(_intrPin);
|
||||
}
|
||||
|
||||
RawDev::end();
|
||||
|
||||
netif_remove(&_netif);
|
||||
|
||||
_started = false;
|
||||
}
|
||||
|
||||
RawDev::end();
|
||||
|
||||
netif_remove(&_netif);
|
||||
|
||||
_started = false;
|
||||
}
|
||||
|
||||
template<class RawDev>
|
||||
|
|
|
|||
Loading…
Reference in a new issue