1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-15 00:02:49 +03:00

fix exception 28 in AP + STA mode and STA disconnect

UDP triggers exception 28
This commit is contained in:
Markus Sattler
2015-06-20 18:36:19 +02:00
parent af4f2d5e28
commit 874cf0ef98
2 changed files with 14 additions and 10 deletions

View File

@ -90,12 +90,15 @@ class ClientContext {
} }
void unref() { void unref() {
DEBUGV(":ur %d\r\n", _refcnt); if(this != 0) {
if(--_refcnt == 0) { DEBUGV(":ur %d\r\n", _refcnt);
flush(); if(--_refcnt == 0) {
close(); flush();
if(_discard_cb) _discard_cb(_discard_cb_arg, this); close();
delete this; if(_discard_cb)
_discard_cb(_discard_cb_arg, this);
delete this;
}
} }
} }

View File

@ -77,10 +77,11 @@ public:
void unref() void unref()
{ {
DEBUGV(":ur %d\r\n", _refcnt); if(this != 0) {
if (--_refcnt == 0) DEBUGV(":ur %d\r\n", _refcnt);
{ if(--_refcnt == 0) {
delete this; delete this;
}
} }
} }