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 » Community » Newbie corner » CTRL + C = 659 Heap leaks
Re: CTRL + C = 659 Heap leaks [message #52039 is a reply to message #52037] Thu, 11 July 2019 09:36 Go to previous messageGo to previous message
Xemuth is currently offline  Xemuth
Messages: 200
Registered: August 2018
Location: France
Experienced Member
Hello Novo, Thanks for you reply.

Quote:
You are, most likely, manually allocating/deallocating memory

Don't think so, I never use New or malloc.

Quote:
you store pointers to polymorphic classes

In my code I use lot of Ptr of type "DiscordModule", the mother class of lot of object stored in this kind of thing :
Upp::Vector<DiscordModule*> AllModules;

I thought it come from that but by launching my code without filling that vector still result on the same huge amount of memory leak !

Quote:
which do not have a virtual destructor, in a container

I tried to declare destructor -> here is definition of my class :
class SmartBotUpp{
	private: 
		Upp::Vector<DiscordModule*> AllModules;
		Discord bot;
		
		Upp::String name="";
		Upp::String token="";
		
		void Event(ValueMap payload);
		Discord* getBotPtr();
	public:
...
};

and here is the destructor
SmartBotUpp::~SmartBotUpp(){
AllModules.Clear();
}


Quote:
AFAIK, you can click on memory leaks in TheIDE, and it will show you where this memory was allocated. I can be wrong, I haven't seen memory leaks in my code for very very long time Rolling Eyes


How you do it ? I get all the memory leak by looking log on theIDE but it's not clickable

Quote:
One interesting thing about U++ is that you almost never need to call new/delete or malloc/free.
Yeah that's exactly what I'm doing. That's why I'm lost Very Happy

Best regard.


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How i can play a sound?? wav,mp3,ogg,aiff????
Next Topic: Filtering an ArrayCtrl
Goto Forum:
  


Current Time: Fri Aug 07 06:11:56 CEST 2020

Total time taken to generate the page: 0.02501 seconds