[reSIProcate] More Heap corruption..

Scott Godin slgodin at icescape.com
Thu Jun 8 09:41:41 CDT 2006


I don't see the problem - this function returns a copy of the list, the original/source should be left untouched.

 

Scott

 

________________________________

From: resiprocate-devel-bounces at list.sipfoundry.org [mailto:resiprocate-devel-bounces at list.sipfoundry.org] On Behalf Of Matthias Moetje - TERASENS GmbH
Sent: Thursday, June 08, 2006 10:26 AM
To: resiprocate-devel at list.sipfoundry.org
Subject: [reSIProcate] More Heap corruption..

 

Hi,

 

I'm currently facing another heap corruption problem. I think this is

caused by the way the RegistrationPersistenceManager::getContacts is implemented:

 

typedef std::list<ContactRecord> ContactRecordList;

virtual ContactRecordList getContacts(const Uri& aor) = 0;

 

When this function is used like:

ContactRecordList mContacts = pStore->getContacts(aor);

then the contents of the returned list get assigned to 
mContacts, but the internal ContactRecordList gets
destroyed which causes it to destroy(delete) all elements
and this is causing the heap corruption because the 
elements are still present in mContacts.

To proof this is skipped the delete in the debugger and 
the corruption message does not occur.

How can we solve this problem? (or am I missing something?)

What about making getContacts return shared_ptr<ContactRecordList>?

Best regards,

Matthias Moetje

 

TERASENS GmbH
Augustenstraße 24
80333 Munich
GERMANY

 

Phone:
Fax:
e-mail:
Web:

 

+49.89.143370-0
+49.89.143370-22
info at terasens.com <mailto:info at terasens.com> 
www.terasens.com <http://www.terasens.com/> 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20060608/3b9df94d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 2937 bytes
Desc: image001.jpg
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20060608/3b9df94d/attachment.jpg>


More information about the resiprocate-devel mailing list