summaryrefslogtreecommitdiff
path: root/libmysql/libmysql.c
diff options
context:
space:
mode:
authorunknown <df@pippilotta.erinye.com>2007-06-21 08:58:39 +0200
committerunknown <df@pippilotta.erinye.com>2007-06-21 08:58:39 +0200
commitb35eceb94427989aa1f764d40e8025bfd85b676a (patch)
treed93851e1d91d78d8a71bd048924f4efcb3be0612 /libmysql/libmysql.c
parent9856f5f7b76da5abb0d442c87dd5e99a9d3ad4d8 (diff)
downloadmariadb-git-b35eceb94427989aa1f764d40e8025bfd85b676a.tar.gz
Steal part of fix for bug#25621 from monty for 5.0.44.mysql-5.0.44clone-5.0.44-build
libmysql/libmysql.c: mysql_server_end() can be called multiple times.
Diffstat (limited to 'libmysql/libmysql.c')
-rw-r--r--libmysql/libmysql.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index e426d2c549e..121167763ed 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -168,8 +168,23 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
}
+/*
+ Free all memory and resources used by the client library
+
+ NOTES
+ When calling this there should not be any other threads using
+ the library.
+
+ To make things simpler when used with windows dll's (which calls this
+ function automaticly), it's safe to call this function multiple times.
+*/
+
+
void STDCALL mysql_server_end()
{
+ if (!mysql_client_init)
+ return;
+
#ifdef EMBEDDED_LIBRARY
end_embedded_server();
#endif