You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/AsyncWebSocket.h
+2-9Lines changed: 2 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -235,20 +235,13 @@ class AsyncWebSocketClient {
235
235
void_clearQueue();
236
236
237
237
// this function is called when a text message is received, in order to copy the buffer and place a null terminator at the end of the buffer for easier handling of text messages.
// Ensure the client object no longer refers to us
1480
+
c->onError({}, nullptr);
1481
+
c->onAck({}, nullptr);
1482
+
c->onDisconnect({}, nullptr);
1483
+
c->onTimeout({}, nullptr);
1484
+
c->onData({}, nullptr);
1485
+
c->onPoll({}, nullptr);
1486
+
// Now that we are no longer bound to the client, self-destruct at the earliest opportunity by moving the shared pointer to a local.
1487
+
// This will decrement the reference count and delete the object when this function ends if there are no other references.
1488
+
// If this function is called by an _onAck handler or the like, the local lock will keep the request object in scope until the handler returns, preventing a use-after-free.
0 commit comments