Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » [BUG] Memory leak in MySql package
Re: [BUG] Memory leak in MySql package [message #39921 is a reply to message #39719] Sat, 11 May 2013 11:27 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
klugier wrote on Sat, 20 April 2013 09:05

Hello Alboni,

You are absolutly right, We need to count global number of MySqlSession instances. If the number of instances falls to zero we need to call mysql_library_end().

I use a memory profiler called valgrind. I invoke him with following command:
valgrind --tool=memcheck --leak-check=full --show-reachable=yes ./ProgramName


I enclose completed patch for this issue. I have added new static variable to count number of instances (numberOfInstances) of the class MySqlSession.

Sincerely,
Klugier



I believe that your code does not really do anything with numberOfInstances - it is always zero.

Anyway, while not quite sure about what mysql_library_end does, what about simply putting it to EXITBLOCK and call when any MySql was performed to keep valgrind quiet?

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Reason why session does not connect
Next Topic: Sql(SqlSession& session) problem
Goto Forum:
  


Current Time: Fri May 17 23:15:28 CEST 2024

Total time taken to generate the page: 0.01888 seconds