Skip to content

Commit

Permalink
- fix response callback de-allocation
Browse files Browse the repository at this point in the history
- do not queue (drop) event messages when not connected
  • Loading branch information
genemars committed Jan 11, 2024
1 parent 34f3383 commit 916ca45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/net/NetManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ namespace Net {
if (!netRequestHandler->onNetRequest(&server, requestUri.c_str(), responseCallback)) {
responseCallback->error("Invalid request.");
};
delete responseCallback;
return true;
}

Expand Down
6 changes: 3 additions & 3 deletions src/service/EventRouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ namespace Service {
}

void EventRouter::signalEvent(QueuedMessage m) {
// if (WiFi.isConnected()) {
eventsQueue.add(m);
// }
if (WiFi.isConnected()) {
eventsQueue.add(m);
}
}

void EventRouter::withNetManager(NetManager &manager) {
Expand Down

0 comments on commit 916ca45

Please sign in to comment.