Commit af2e75cd authored by Will DeVries's avatar Will DeVries Committed by Sergei Petrunia

Clean up ClustrixDB handlerton memory.

parent aaa182b1
...@@ -53,13 +53,20 @@ static MYSQL_SYSVAR_STR ...@@ -53,13 +53,20 @@ static MYSQL_SYSVAR_STR
int host_list_cnt; int host_list_cnt;
char **host_list; char **host_list;
static void update_host_list(char *clustrix_host)
static void free_host_list()
{ {
if (host_list) { if (host_list) {
for (int i = 0; host_list[i]; i++) for (int i = 0; host_list[i]; i++)
my_free(host_list[i]); my_free(host_list[i]);
my_free(host_list); my_free(host_list);
host_list = NULL;
} }
}
static void update_host_list(char *clustrix_host)
{
free_host_list();
int cnt = 0; int cnt = 0;
for (char *p = clustrix_host, *s = clustrix_host; ; p++) { for (char *p = clustrix_host, *s = clustrix_host; ; p++) {
...@@ -1153,6 +1160,13 @@ static int clustrixdb_init(void *p) ...@@ -1153,6 +1160,13 @@ static int clustrixdb_init(void *p)
DBUG_RETURN(0); DBUG_RETURN(0);
} }
static int clustrixdb_deinit(void *p)
{
DBUG_ENTER("clustrixdb_deinit");
free_host_list();
DBUG_RETURN(0);
}
struct st_mysql_show_var clustrixdb_status_vars[] = struct st_mysql_show_var clustrixdb_status_vars[] =
{ {
{NullS, NullS, SHOW_LONG} {NullS, NullS, SHOW_LONG}
...@@ -1186,7 +1200,7 @@ maria_declare_plugin(clustrixdb) ...@@ -1186,7 +1200,7 @@ maria_declare_plugin(clustrixdb)
"ClustrixDB storage engine", /* Plugin Description */ "ClustrixDB storage engine", /* Plugin Description */
PLUGIN_LICENSE_GPL, /* Plugin Licence */ PLUGIN_LICENSE_GPL, /* Plugin Licence */
clustrixdb_init, /* Plugin Entry Point */ clustrixdb_init, /* Plugin Entry Point */
NULL, /* Plugin Deinitializer */ clustrixdb_deinit, /* Plugin Deinitializer */
0x0001, /* Hex Version Number (0.1) */ 0x0001, /* Hex Version Number (0.1) */
NULL /* clustrixdb_status_vars */, /* Status Variables */ NULL /* clustrixdb_status_vars */, /* Status Variables */
clustrixdb_system_variables, /* System Variables */ clustrixdb_system_variables, /* System Variables */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment