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 » Why this one leaks ?
Why this one leaks ? [message #33766] Sun, 11 September 2011 17:07 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor

#include <Core/Core.h>

using namespace Upp;

class Base : public Pte<Base>
{
	public:
		String BaseData;
		Base() { BaseData = "Sample data in Base class"; }
};
	
CONSOLE_APP_MAIN
{
	Ptr<Base> b = new Base;
	
}



Shouldn't be created element freed on Ptr destruction ?
Here the Upp log :

Heap leaks detected:

--memory-breakpoint__ 1120 : Memory at 0x7f70bdb87210, size 0x20 = 32
    +0 0x00007F70BDB87210 53 61 6D 70 6C 65 20 64 61 74 61 20 69 6E 20 42     Sample data in B
   +16 0x00007F70BDB87220 61 73 65 20 63 6C 61 73 73 00 65 65 46 72 65 65     ase class.eeFree

--memory-breakpoint__ 1119 : Memory at 0x7f70bdb872b0, size 0x28 = 40
    +0 0x00007F70BDB872B0 00 00 00 00 00 00 00 00 19 00 00 00 46 72 65 65     ............Free
   +16 0x00007F70BDB872C0 10 72 B8 BD 70 7F 00 00 10 72 B8 BD 70 7F 00 00     .r¸½p...r¸½p..
   +32 0x00007F70BDB872D0 19 00 00 00 00 00 1F 0F                             ........        
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: read/write to pipe /dev/rtp..?
Next Topic: Array : swapping element with a pointer
Goto Forum:
  


Current Time: Thu May 09 21:53:07 CEST 2024

Total time taken to generate the page: 0.02792 seconds