Skip to content

Commit 7a40f1f

Browse files
committed
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
1 parent e27404a commit 7a40f1f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ractor_sync.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,10 @@ ractor_sync_mark(rb_ractor_t *r)
663663
static void
664664
ractor_sync_free(rb_ractor_t *r)
665665
{
666+
if (r->sync.recv_queue) {
667+
ractor_queue_free(r->sync.recv_queue);
668+
}
669+
666670
// maybe NULL
667671
if (r->sync.ports) {
668672
st_free_table(r->sync.ports);

0 commit comments

Comments
 (0)