Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » valgrind problem, heap-leak debugging
valgrind problem, heap-leak debugging [message #44252] |
Fri, 13 February 2015 08:05  |
slashupp
Messages: 231 Registered: July 2009
|
Experienced Member |
|
|
Running my app ends with "Heap-leaks detected".
I don't do "new" anywhere, so there is no obvious place to start looking for the problem.
So I try [Debug/Test with Valgrind] and get a huge amount of output.
This is not helpful.
1. Is there a way I can force valgrind to just focus on my app and ignore upp-sources?
2. What other ways can I use to find the cause of the heap-leak?
---
PS: .. to maybe help others with same kind of problem ..
I've found the cause: needed a virtual dtor in a struct I was using, added it and the heap-leaks went away.
How I found it: Searched SO and found this answer [http://stackoverflow.com/a/2480641/15161]:
Quote:[..] code that creates your object on the heap. It would be bad practice for your class to assume that it is always going to be created on the stack...
My struct is defined within a class and instances are created, used and passed as parameters
all over the place (without the SO-clue (and only with this dysfunctional valgrind-hook) it would have
been a real mission to find)
The two questions I think remains valid and any answers would be helpful for the future.
[Updated on: Fri, 13 February 2015 09:12] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Tue Apr 29 04:22:29 CEST 2025
Total time taken to generate the page: 0.01295 seconds
|