[Groonga-mysql-commit] mroonga/mroonga [fix-for-visual-studio] close opened DBs on deinit.

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Oct 4 10:32:16 JST 2012


Kouhei Sutou	2011-11-22 16:38:07 +0900 (Tue, 22 Nov 2011)

  New Revision: b438ac8153b9e3d9e46d00a18ce6cc45f39d612e
  https://github.com/mroonga/mroonga/commit/b438ac8153b9e3d9e46d00a18ce6cc45f39d612e

  Log:
    close opened DBs on deinit.

  Modified files:
    ha_mroonga.cc

  Modified: ha_mroonga.cc (+6 -0)
===================================================================
--- ha_mroonga.cc    2011-11-22 15:49:11 +0900 (3b87ecc)
+++ ha_mroonga.cc    2011-11-22 16:38:07 +0900 (b9a6483)
@@ -1051,6 +1051,7 @@ static int mrn_deinit(void *p)
 {
   THD *thd = current_thd, *tmp_thd;
   grn_ctx *ctx = &mrn_ctx;
+  void *value;
 
   GRN_LOG(ctx, GRN_LOG_NOTICE, "%s deinit", MRN_PACKAGE_STRING);
 
@@ -1072,6 +1073,11 @@ static int mrn_deinit(void *p)
   pthread_mutex_destroy(&mrn_allocated_thds_mutex);
   pthread_mutex_destroy(&mrn_log_mutex);
   pthread_mutex_destroy(&mrn_db_mutex);
+  GRN_HASH_EACH(ctx, mrn_hash, id, NULL, 0, &value, {
+    grn_obj *db;
+    memcpy(&db, value, sizeof(grn_obj *));
+    grn_obj_unlink(ctx, db);
+  });
   grn_hash_close(ctx, mrn_hash);
   grn_obj_unlink(ctx, mrn_db);
 
-------------- next part --------------
HTML����������������������������...
下載 



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