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
Fix double-delete cases when AsyncWebRequest is being transformed in to
another form. Adoping the AsyncClient from the AsyncWebRequest now
marks it for cleanup internally, so handlers need not delete it
manually.
H/T @mathieucarbou
// 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