summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-06-04 23:16:57 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-06-04 23:16:57 -0700
commit68e2c7ecbd28afca66507306c4751481270fbf10 (patch)
tree91a4ec0133797bb63dbc021b94510399a8fb645d /ext
parentbebfe63aaa939e63b6b0871df3186be02b028256 (diff)
downloadffi-yajl-68e2c7ecbd28afca66507306c4751481270fbf10.tar.gz
add more garbage collection mitigation
Diffstat (limited to 'ext')
-rw-r--r--ext/ffi_yajl/ext/parser/parser.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/ffi_yajl/ext/parser/parser.c b/ext/ffi_yajl/ext/parser/parser.c
index 9256469..8f9ccc0 100644
--- a/ext/ffi_yajl/ext/parser/parser.c
+++ b/ext/ffi_yajl/ext/parser/parser.c
@@ -170,6 +170,8 @@ static VALUE mParser_do_yajl_parse(VALUE self, VALUE str, VALUE opts) {
/* hack to avoid garbage collection */
rb_ivar_set(self, rb_intern("stack"), ctx.stack);
rb_ivar_set(self, rb_intern("key_stack"), ctx.key_stack);
+ rb_ivar_set(self, rb_intern("finished"), ctx.stack);
+ rb_ivar_set(self, rb_intern("key"), ctx.stack);
hand = yajl_alloc(&callbacks, NULL, &ctx);
if ((stat = yajl_parse(hand, (unsigned char *)RSTRING_PTR(str), RSTRING_LEN(str))) != yajl_status_ok) {