Fix to check if receiver is null before gc unregister on_gc_dispose_channel
@@ -55,7 +55,9 @@ static void on_gc_dispose_channel(mrb_state *mrb, void *_ctx)
{
struct st_h2o_mruby_channel_context_t *ctx = _ctx;
assert(ctx != NULL); /* ctx can only be disposed by gc, so data binding has been never removed */
+ if (!mrb_nil_p(ctx->receiver)) {
mrb_gc_unregister(mrb, ctx->receiver);
+ }
free(ctx);
}
