浏览代码

db_postgres: added mod destroy function

- clear locks set used for replace command
Daniel-Constantin Mierla 13 年之前
父节点
当前提交
0a946efc52
共有 1 个文件被更改,包括 9 次插入3 次删除
  1. 9 3
      modules/db_postgres/pg_mod.c

+ 9 - 3
modules/db_postgres/pg_mod.c

@@ -51,10 +51,11 @@
 #include <float.h>
 #include <float.h>
 #endif
 #endif
 
 
-static int pg_mod_init(void);
-
 MODULE_VERSION
 MODULE_VERSION
 
 
+static int pg_mod_init(void);
+static void pg_mod_destroy(void);
+
 int pg_connect_timeout = 0;  /* Default is unlimited */
 int pg_connect_timeout = 0;  /* Default is unlimited */
 int pg_retries = 2;  /* How many times should the module try re-execute failed commands.
 int pg_retries = 2;  /* How many times should the module try re-execute failed commands.
 					  * 0 disables reconnecting */
 					  * 0 disables reconnecting */
@@ -102,7 +103,7 @@ struct module_exports exports = {
 	params,       /* module parameters */
 	params,       /* module parameters */
 	pg_mod_init,  /* module initialization function */
 	pg_mod_init,  /* module initialization function */
 	0,            /* response function*/
 	0,            /* response function*/
-	0,            /* destroy function */
+	pg_mod_destroy,  /* destroy function */
 	0,            /* oncancel function */
 	0,            /* oncancel function */
 	0             /* per-child init function */
 	0             /* per-child init function */
 };
 };
@@ -555,4 +556,9 @@ static int pg_mod_init(void)
 	return km_postgres_mod_init();
 	return km_postgres_mod_init();
 }
 }
 
 
+static void pg_mod_destroy(void)
+{
+	pg_destroy_lock_set();
+}
+
 /** @} */
 /** @} */