1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-25 01:37:19 +00:00

Fix memory leak with threaded channels.

This commit is contained in:
Calvin Rose 2021-08-15 15:33:26 -05:00
parent b75b3e3984
commit 894a3b2fe2

View File

@ -746,6 +746,7 @@ static int janet_chanat_gc(void *p, size_t s) {
janet_chan_lock(channel); janet_chan_lock(channel);
if (--channel->ref_count == 0) { if (--channel->ref_count == 0) {
janet_chan_deinit(channel); janet_chan_deinit(channel);
janet_free(channel);
} else { } else {
janet_chan_unlock(channel); janet_chan_unlock(channel);
} }