HAYASHI Kentaro
null+****@clear*****
Sat Jan 16 12:27:43 JST 2016
HAYASHI Kentaro 2016-01-16 12:27:43 +0900 (Sat, 16 Jan 2016) New Revision: 0569d17c78b6db072b1b96267bc02eb338d27d09 https://github.com/groonga/groonga/commit/0569d17c78b6db072b1b96267bc02eb338d27d09 Message: Fix crash bug at the end when GRN_RUBY_SCRIPTS_DIR is not correct In such a care, grn_cache_init() or grn_request_canceler_init() are not called, as a result, Groonga crashes when finalizer is called. Note that mruby enabled build is affected. Modified files: lib/ctx.c lib/request_canceler.c Modified: lib/ctx.c (+2 -1) =================================================================== --- lib/ctx.c 2016-01-15 21:53:42 +0900 (63b284a) +++ lib/ctx.c 2016-01-16 12:27:43 +0900 (c7286e1) @@ -2011,7 +2011,8 @@ void grn_cache_fin(void) { grn_cache_current_set(&grn_gctx, NULL); - grn_cache_close(&grn_gctx, grn_cache_default); + if (grn_cache_default) + grn_cache_close(&grn_gctx, grn_cache_default); } /**** memory allocation ****/ Modified: lib/request_canceler.c (+3 -0) =================================================================== --- lib/request_canceler.c 2016-01-15 21:53:42 +0900 (866292f) +++ lib/request_canceler.c 2016-01-16 12:27:43 +0900 (261e1fb) @@ -116,6 +116,9 @@ grn_request_canceler_fin(void) { grn_ctx *ctx = &grn_gctx; + if (!grn_the_request_canceler) + return; + grn_hash_close(ctx, grn_the_request_canceler->entries); MUTEX_FIN(grn_the_request_canceler->mutex); GRN_FREE(grn_the_request_canceler); -------------- next part -------------- HTML����������������������������...Download