List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:November 26 2007 8:58pm
Subject:Re: Is method "const ColData Row::at(size_type i) const" leaking
memory?
View as plain text  
Thunder0 wrote:
> 
> (const_string.h:110)==10964==    

Try making ~const_string() virtual and rebuilding.

I don't really expect that to fix it, because if it does, it means 
someone somewhere is holding references to ColData<const_string> objects 
by pointers to the base class and deleting them through that pointer. 
That shouldn't be happening, because as far as I know, everyone keeps 
ColData objects as ColData.  (This lack of use of the is-a property of 
inheritance is one reason why ColData no longer uses inheritance in v3.)

If, as seems more likely, making the base class dtor virtual doesn't 
help, I'm at a total loss.  You can clearly see in const_string.h that 
memory allocated in the ctors gets deallocated in the dtor.  When a 
ColData_Tmpl<const_string> object goes away, ~const_string() should be 
called, freeing up the memory.
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