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
php#53: Fix ref_count management for async event callbacks
This commit fixes a critical memory management issue in the async event
callback system where callbacks were created with ref_count=1 but add
methods didn't increment the counter, leading to premature deallocation.
Changes:
- Initialize all callbacks with ref_count=0 instead of 1
- Add ref_count increment in callback registration methods
- Remove incorrect ref_count validation in zend_async_resume_when
Modified files:
* Zend/zend_async_API.c: Fix zend_async_coroutine_callback_new and
waker_trigger_add_callback
* Zend/zend_async_API.h: Fix zend_async_callbacks_push
* main/network_async.c: Fix 5 direct callback initializations for
poll_callback_t, select_callback_t, async_stream_callback_t, and
dns_callback_t structures
This ensures proper lifetime management for all async callback types
including socket, DNS, stream, and scope callbacks.
0 commit comments