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 #52056 is a reply to message #52054] Fri, 12 July 2019 00:46 Go to previous messageGo to previous message
Novo is currently offline  Novo
Messages: 934
Registered: December 2006
Experienced Contributor
mirek wrote on Thu, 11 July 2019 18:15

I believe you are wrong. I believe Ctrl+C is equivalent of calling exit(). In that case, global variables get destructed, but local variables do not. This is also quite clear for the implementation of signals - they are asynchronouse and thus do not have to use the same stack so no stack unwinding is possible.

BTW, destructing global variables is the mechanism used to activate the leak checker Smile

Mirek

I saw that MemDiagCls is a global static ...
Let's say only global statics get destroyed, and stack doesn't get unwinded. In such case every time you press CTRL-C you should get memory leaks. But this never happens to my apps ... BTW, info for stack unwinding is always included into app, especially when you compile it with exception support (this is related to x64 Win and POSIX ABI).

"no stack unwinding is possible" - try to run an app with gdb and press CTRL-C. gdb will stop each thread in your app and will show you call stacks for each thread. Call stack for each thread can we unwinded, IMHO ...

This is my understanding of this process ...


Regards,
Novo
 
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 09 08:35:14 CEST 2020

Total time taken to generate the page: 0.01341 seconds