Hi all,
I've managed to abuse valgrind to show backtraces of all places where an AddRef and Release is called when there is a memory, this is superior to wading through an endless pile of logs without even guarantee it will work.
I thought I should share it for the following reasons: 1. Valgrind is an awesome tool 2. Reference leaks are usually impossible or very hard to find by using debug logs
All I'm doing is leaking memory until the destructor is called, which gives quite useful results, I had to add a exit(1) after the leak occured because the samples get destroyed regardless when the interface controlling those samples is released.
The log was created with: valgrind --trace-children=yes --leak-check=full --show-reachable=yes --leak-resolution=high -- wine quartz_test.exe.so filtergraph 2>&1 | tee valgrind.log
And then I removed all the memory leaks and warnings not related to AddRef and Release.
Ideally I could get it to automatically sort the outputted data based on the order of calling, but I'm not 100% sure how to do that yet. I could do 1,000,000 + GetTickCount(), but the results are usable now regardless.
This was useful for me to get the backtraces of all _AddRef's and _Release's *ONLY* for the leaking interfaces, which saves a lot of time determining whether the specific interface is leaking and not, and when it starts leaking, and then determining who calls and where it is called, so I hope it is useful for you too!
Cheers, Maarten.