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 #52076 is a reply to message #52073] Tue, 16 July 2019 09:38 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Novo wrote on Tue, 16 July 2019 02:11
mirek wrote on Mon, 15 July 2019 18:11

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

I do not understand why. Just do not show memory leak report when an object on stack wasn't destroyed.


Maybe we are nor speaking about the same thing...

struct Foo {
   byte *ptr;

   ~Foo() { if(ptr) delete[] ptr; } // this might be missing
};

Foo foo;

CONSOLE_APP_MAIN {
   foo.ptr = new byte[1000];
}


If you couple leaks detection to stack, either that leak is wrongly ignored or not leak wrongly reported (depending on what exactly you do).

Really the only sensible thing to do is either somehow make Ctrl+C call Exit by installing exception handler in Win32, but that is hard as the handler is running in different thread, or make it disable leak checks completely in Win32 in Ctrl+C exception handler.
 
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 Apr 26 14:49:27 CEST 2024

Total time taken to generate the page: 0.02234 seconds