[Groonga-commit] groonga/groonga at 672ef5a [master] plugin mrb: fix memory leak for re-using mruby based command in multiple contexts

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Feb 16 12:52:37 JST 2015


Kouhei Sutou	2015-02-16 12:52:37 +0900 (Mon, 16 Feb 2015)

  New Revision: 672ef5a49ae08ed8fb1a0d6500671fc2553338f9
  https://github.com/groonga/groonga/commit/672ef5a49ae08ed8fb1a0d6500671fc2553338f9

  Message:
    plugin mrb: fix memory leak for re-using mruby based command in multiple contexts

  Modified files:
    lib/db.c

  Modified: lib/db.c (+3 -0)
===================================================================
--- lib/db.c    2015-02-16 12:52:09 +0900 (d9f8e15)
+++ lib/db.c    2015-02-16 12:52:37 +0900 (625ab41)
@@ -597,6 +597,9 @@ grn_proc_create(grn_ctx *ctx, const char *name, int name_size, grn_proc_type typ
           ERR(GRN_INVALID_ARGUMENT, "already used name");
           GRN_API_RETURN(NULL);
         }
+        if (range != GRN_ID_NIL) {
+          grn_plugin_close(ctx, range);
+        }
         GRN_API_RETURN((grn_obj *)res);
       } else {
         added = 1;
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index