[Groonga-mysql-commit] mroonga/mroonga at 07701b8 [master] mysql8: use destroy() for deleting allocated memory

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Jul 19 14:19:54 JST 2018


Kouhei Sutou	2018-07-19 14:19:54 +0900 (Thu, 19 Jul 2018)

  New Revision: 07701b8b4a0bd9f0626d30bf17a636e4d49e013b
  https://github.com/mroonga/mroonga/commit/07701b8b4a0bd9f0626d30bf17a636e4d49e013b

  Message:
    mysql8: use destroy() for deleting allocated memory

  Modified files:
    ha_mroonga.cpp
    mrn_mysql_compat.h

  Modified: ha_mroonga.cpp (+2 -2)
===================================================================
--- ha_mroonga.cpp    2018-07-19 14:07:42 +0900 (cfe2c22a)
+++ ha_mroonga.cpp    2018-07-19 14:19:54 +0900 (f7060ecd)
@@ -2951,7 +2951,7 @@ ha_mroonga::~ha_mroonga()
 
   if (analyzed_for_create) {
     if (wrap_handler_for_create) {
-      delete wrap_handler_for_create;
+      mrn_destroy(wrap_handler_for_create);
     }
     if (share_for_create.wrapper_mode) {
       plugin_unlock(NULL, share_for_create.plugin);
@@ -3525,7 +3525,7 @@ int ha_mroonga::wrapper_create(const char *name,
   MRN_SET_BASE_SHARE_KEY(tmp_share, table->s);
   MRN_SET_BASE_TABLE_KEY(this, table);
   share = NULL;
-  delete hnd;
+  mrn_destroy(hnd);
 
   if (error) {
     mrn::PathMapper mapper(name);

  Modified: mrn_mysql_compat.h (+6 -0)
===================================================================
--- mrn_mysql_compat.h    2018-07-19 14:07:42 +0900 (04d957a4)
+++ mrn_mysql_compat.h    2018-07-19 14:19:54 +0900 (34e790a7)
@@ -737,3 +737,9 @@ typedef HASH mrn_table_def_cache_type;
 // TODO
 /* #define mrn_thd_set_ha_data(thd, hton, ha_data) \ */
 /*    thd_set_ha_data(thd, hton, ha_data) */
+
+#if MYSQL_VERSION_ID >= 80011 && !defined(MRN_MARIADB_P)
+#  define mrn_destroy(pointer) destroy(pointer)
+#else
+#  define mrn_destroy(pointer) delete pointer
+#endif
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-mysql-commit/attachments/20180719/a7871522/attachment.htm 



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