MySQL Forums
Forum List  »  Connector/C++

Re: Error in my_thread_global_end(): 7 threads didn't exit
Posted by: Andrey Hristov
Date: September 21, 2009 10:00AM

Ok, I think the problem is the following. Opening a connection in a child thread calls mysql_init(), which in turns calls my_thread_init() to initialize structures for dbg and mysys (internal stuff) per thread. Now, when your thread finishes it doesn't call mysql_thread_end(), which in turns calls my_thread_end() and the memory is not deallocated. At global shutdown libmysql checks a counter of non-cleaned threads, in your case 7 and barks. You won't see the message if libmysql is compiled release, instead of debug but the memory leak will be there. There should be a way to call mysql_thread_end(), extending the API.

Andrey Hristov, Software Developer
MySQL AB, www.mysql.com

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Error in my_thread_global_end(): 7 threads didn't exit
3352
September 21, 2009 10:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.