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 #52072 is a reply to message #52071] Tue, 16 July 2019 00:11 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Novo wrote on Mon, 15 July 2019 20:18
mirek wrote on Mon, 15 July 2019 13:35
Novo wrote on Mon, 15 July 2019 17:16
mirek wrote on Mon, 15 July 2019 02:17
Novo wrote on Mon, 15 July 2019 06:15

This is not a correct behavior.


There is no correct behaviour. This is not defined anywhere in c++ standard.

Mirek

In this case this is a bug with U++. MemDiagCls shouldn't be a global object. It should be created on stack (by GUI_APP_MAIN or by CONSOLE_APP_MAIN). IMHO.


Then it would not work. Think about all that memory allocated in global objects... (and worse, not in initialization phase).

Instead of MemDiagCls you can put on stack a guard-object, which will detect that its destructor got called and set a flag on MemDiagCls.
IMHO, the problem is fixable ...


Yeah, but then I will not catch leaks in global objects.

I could install Ctrl+C handler and do the same trick (disable leaks checker), but is it worth the effort?

Mirek
 
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: Thu Apr 25 14:07:22 CEST 2024

Total time taken to generate the page: 0.01802 seconds