Fix memory leak of Ractor recv_queue

Memory leak reported:

    3   miniruby                              0x104702c1c ractor_init + 164  ractor.c:460
    2   miniruby                              0x1046496a0 ruby_xmalloc + 44  gc.c:5188
    1   miniruby                              0x10464e840 rb_gc_impl_malloc + 148  default.c:8140
    0   libsystem_malloc.dylib                0x19ab3912c _malloc_zone_malloc_instrumented_or_legacy + 152
This commit is contained in:
Peter Zhu 2025-06-03 11:23:25 -04:00
parent e27404af9e
commit 7a40f1f06c
Notes: git 2025-06-03 19:48:52 +00:00

View File

@ -663,6 +663,10 @@ ractor_sync_mark(rb_ractor_t *r)
static void
ractor_sync_free(rb_ractor_t *r)
{
if (r->sync.recv_queue) {
ractor_queue_free(r->sync.recv_queue);
}
// maybe NULL
if (r->sync.ports) {
st_free_table(r->sync.ports);