diff --git a/CHANGELOG.md b/CHANGELOG.md index 79d512b4..29536060 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 3.13.23 - 2022-11-06 + +- Fixed issue with Oj::Parser extension regarding GC timeing. + ## 3.13.22 - 2022-11-01 - Reorganized Oj::Parser code to allow for parser extensions in C. diff --git a/ext/oj/parser.c b/ext/oj/parser.c index a1521038..b800c93d 100644 --- a/ext/oj/parser.c +++ b/ext/oj/parser.c @@ -1145,7 +1145,9 @@ static void parser_free(void *ptr) { p = (ojParser)ptr; buf_cleanup(&p->key); buf_cleanup(&p->buf); - p->free(p); + if (NULL != p->free) { + p->free(p); + } xfree(ptr); } @@ -1156,7 +1158,9 @@ static void parser_mark(void *ptr) { if (0 != p->reader) { rb_gc_mark(p->reader); } - p->mark(p); + if (NULL != p->mark) { + p->mark(p); + } } } diff --git a/lib/oj/version.rb b/lib/oj/version.rb index 96280b6b..1c45ef11 100644 --- a/lib/oj/version.rb +++ b/lib/oj/version.rb @@ -1,5 +1,5 @@ module Oj # Current version of the module. - VERSION = '3.13.22' + VERSION = '3.13.23' end