[Groonga-mysql-commit] mroonga/mroonga at 4011f34 [master] Fix a memory leak with groonga-normalizer-mysql

アーカイブの一覧に戻る

Kouhei Sutou null+****@clear*****
Sun Jun 9 20:18:04 JST 2013


Kouhei Sutou	2013-06-09 20:18:04 +0900 (Sun, 09 Jun 2013)

  New Revision: 4011f34fd6c97fe23b7ebc4294cad04a7b1a49ff
  https://github.com/mroonga/mroonga/commit/4011f34fd6c97fe23b7ebc4294cad04a7b1a49ff

  Message:
    Fix a memory leak with groonga-normalizer-mysql
    
    If normalizers/mysql is already registered, registering it again
    causes a memory leak.

  Modified files:
    ha_mroonga.cpp

  Modified: ha_mroonga.cpp (+9 -1)
===================================================================
--- ha_mroonga.cpp    2013-06-09 09:05:14 +0900 (388f077)
+++ ha_mroonga.cpp    2013-06-09 20:18:04 +0900 (56d9cf8)
@@ -3920,7 +3920,15 @@ int ha_mroonga::ensure_database_create(const char *name)
   pthread_mutex_unlock(&mrn_db_mutex);
   grn_ctx_use(ctx, db);
 #ifdef WITH_GROONGA_NORMALIZER_MYSQL
-  grn_plugin_register(ctx, GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME);
+  {
+    grn_obj *mysql_normalizer;
+    mysql_normalizer = grn_ctx_get(ctx, "NormalizerMySQLGeneralCI", -1);
+    if (mysql_normalizer) {
+      grn_obj_unlink(ctx, mysql_normalizer);
+    } else {
+      grn_plugin_register(ctx, GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME);
+    }
+  }
 #endif
 
   DBUG_RETURN(error);
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-mysql-commit mailing list
アーカイブの一覧に戻る