List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:November 22 2007 1:28am
Subject:Re: Is method "const ColData Row::at(size_type i) const" leaking
memory?
View as plain text  
Thunder0 wrote:
> ==22261== 111 bytes in 6 blocks are definitely lost in loss record 3 of 7

A 111 byte memory leak wasn't a big deal even back in my DOS days...

> ==22261==    by 0x404B05F: mysqlpp::Row::at(unsigned) const
> (const_string.h:123)==22261==    by 0x404B3E6: mysqlpp::Row::operator[](char
> const*) const (row.cpp:115)

This completely confuses me.  There is no Row::operator[](const char*) 
at line 115 in row.cpp in any of the major past MySQL++ versions: 
1.7.40, 2.0.7, 2.1.1, 2.2.3, or 2.3.2.  The operator exists, but it is 
in a different place in all these versions.  What version are you running?

> std::string value(row["ID_N"]);// >>>>>> line 590 mentioned in
> valgrind

Yes, this does allocate a bit of memory.  The operator referenced in the 
previous quote calls ResUse::field_num(const std::string&), which 
allocates a FieldNames() object to handle the translation between field 
name and field index.  But, it's destroyed when the ResUse/Result object 
gets destroyed, so the only way you should be seeing a leak is if your 
code isn't disposing of the MySQL++ objects it creates.
Thread
Is method "const ColData Row::at(size_type i) const" leaking memory?Thunder021 Nov
  • Re: Is method "const ColData Row::at(size_type i) const" leakingmemory?Warren Young22 Nov
Re: Is method "const ColData Row::at(size_type i) const" leaking memory?Thunder026 Nov
  • Re: Is method "const ColData Row::at(size_type i) const" leakingmemory?Warren Young26 Nov
    • Re: Is method "const ColData Row::at(size_type i) const" leaking memory?Graham Reitz27 Nov
      • Re: Query object seg. faults on destruction...Graham Reitz27 Nov
        • Re: Query object seg. faults on destruction...Warren Young27 Nov
          • Re: Query object seg. faults on destruction...Graham Reitz27 Nov
            • Re: Query object seg. faults on destruction...Warren Young27 Nov
              • Re: Query object seg. faults on destruction...Graham Reitz28 Nov
Re: Is method "const ColData Row::at(size_type i) const" leaking memory?Thunder027 Nov
  • Re: Is method "const ColData Row::at(size_type i) const" leakingmemory?Warren Young27 Nov
Re: Is method "const ColData Row::at(size_type i) const" leaking memory?Thunder028 Nov
  • Re: Is method "const ColData Row::at(size_type i) const" leakingmemory?Warren Young28 Nov