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++ Core » ~Link
~Link [message #38843] Wed, 23 January 2013 12:26 Go to previous message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Hi,

I made a little test with Link utility class and heap leaks have been detected when I use the following code:

struct LinkTest : Link<LinkTest> {
};

CONSOLE_APP_MAIN
{
	LinkTest lt;
	lt.InsertPrev();
	lt.InsertNext();
	lt.Dump();
}

This comes from the fact that the whole list is not destroyed when the destructor of lt is called at the end of the programm, but instead only lt is removed and the other heap allocated members in the list remain.

I propose to call DeleteList() in ~Link instead of calling UnLinkAll(). If one wants to unlink a single object obj within the list an obj.UnlinkAll() can be used.

It just does not feel the U++ way to me to have to call lt.DeleteList() at the end of the program.

Regards
Matthias
 
Read Message
Read Message
Read Message
Previous Topic: Repeatable crash
Next Topic: Is FrameLess() working under Linux ?
Goto Forum:
  


Current Time: Sun Apr 11 17:59:47 CEST 2021

Total time taken to generate the page: 0.01048 seconds