| Bug #2061 | key created by pthread_key_create is never deleted | ||
|---|---|---|---|
| Submitted: | 9 Dec 2003 12:06 | Modified: | 10 Dec 2003 16:16 |
| Reporter: | [ name withheld ] | ||
| Status: | Closed | ||
| Category: | Server | Severity: | S2 (Serious) |
| Version: | 4.0.16 | OS: | Mac OS X (Mac OS X) |
| Assigned to: | Bugs System | Target Version: | |
[9 Dec 2003 12:06]
[ name withheld ]
[9 Dec 2003 12:54]
[ name withheld ]
This COULD be related to bugs 1772 and 1069. This is just a guess, based on the fact that my_thread_global_init makes mutices, and if my_thread_global_end is never called, they could leak memory...
[10 Dec 2003 16:16]
Michael Widenius
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.
If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information
about accessing the source trees is available at
http://www.mysql.com/doc/en/Installing_source_tree.html
Additional info:
I changed the code to use pthread_key_delete() as this makes the code a bit more clear;
This should not have any notable effects on other platforms as the key should normally be
cleared by the thread library (becasue of the free argument to pthread_key_create())
There is no need for a mysql_end() function. The function mysql_server_end() already
calls my_end().
[11 Dec 2003 14:19]
[ name withheld ]
What if the program is a client, rather than a server? Then it has not called mysql_server_init(), and probably should not call mysql_server_end(). Hence the suggestion for a mysql_end() function.
