diff options
author | Peter Zhu <[email protected]> | 2025-06-03 11:23:25 -0400 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2025-06-03 15:48:38 -0400 |
commit | 7a40f1f06ce099455065dd98b2f8ce1d71946c6c (patch) | |
tree | 2b3481ce8343df32d68fa0978a40221398905f3a /ractor_sync.c | |
parent | e27404af9e2888bede6667e4bd0a145c4efa7c46 (diff) |
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
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13504
Diffstat (limited to 'ractor_sync.c')
-rw-r--r-- | ractor_sync.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ractor_sync.c b/ractor_sync.c index 57aea296c2..31ac2df4cf 100644 --- a/ractor_sync.c +++ b/ractor_sync.c @@ -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); |