On Wed, 25 Nov 2015 11:07:53 -0500, Timothy Bish <tabish...@gmail.com> wrote:
>On 11/25/2015 10:50 AM, spamtrap wrote: >> On Wed, 25 Nov 2015 09:33:38 -0500, Timothy Bish >> <tabish...@gmail.com> wrote: >> >>> On 11/25/2015 05:47 AM, spam trap wrote: >>>> Hi, >>>> >>>> I have the following code: >>>> >>>> cms::Message *pMessage; >>>> ... >>>> std::vector<std::string> propertyNames = pMessage->getPropertyNames(); >>>> >>>> According to valgrind this leaks memory. propertyNames is on the >>>> stack BTW. >>>> >>>> ==27758== 50,039,920 (289,968 direct, 49,749,952 indirect) bytes in >>>> 6,041 blocks are definitely lost in loss record 383 of 384 >>>> ==27758== at 0x4A075FC: operator new(unsigned long) >>>> (vg_replace_malloc.c:298) >>>> ==27758== by 0x5F77EF9: decaf::util::StlMap<std::string, >>>> activemq::util::PrimitiveValueNode, >>>> decaf::util::comparators::Less<std::string> >::keySet() const >>>> (StlMap.h:866) >>>> ==27758== by 0x5C3799E: >>>> activemq::commands::ActiveMQMessageTemplate<cms::BytesMessage>::getPropertyNames() >>>> const (ActiveMQMessageTemplate.h:109) >>>> >>>> Any ideas? >>>> >>>> >> >From a quick code inspection I don't see any case where a leak can >>> occur. If you can add a test case to the existing set of unit tests for >>> the Message objects to reproduce the valgrind complaint I will look again. >>> >>> Try adding something to src/test/activemq/commands/ActiveMQMessageTest.h/cpp >> Where are the binaries placed for the test programs? I can't seem to >> find them. >> >> >> >Depends on how you are building them, what is the environment and build >process? Linux 64 bit. I've run: configure .... make make install make check