Paul Thornton posted a nice question on G+ two weeks ago:
Interfaces are great, but they can be a pain to debug. Forgetting one weak link can lead to Access Violation hell. I seem to remember a utility that would let you visualise the links between interfaced objects, but can’t remember what it was called. Anybody know?
Do you have any clever interface debugging tips or tricks?
Mixing object and interface references leads to complex situations, especially when some classes make refcounting go away (not limited to UI components) so refactoring is a good idea, it at all possible:
Lars Dybdahl:
Refactor them away :-)
When the mix of interface reference counting and TObject gets so complex, that the source code is no longer obvious, maintenance costs sometimes become too high and another solution might be better.
Nicholas Ring:
+Lars Dybdahl Totally agree and it is even worse when reference counting is disabled (like adding an interface reference to an UI component).
There is not much tooling, this thread only mentioned RefCountTracer and FastMM:
Steffen Binas:
There is this: https://github.com/AquaSoftGmbH/RefCountTracer
It helps you find memoryleaks, but also could show you if a refcount goes below 0.
Paul Thornton:
This link was very useful. It also points to a good FastMM tutorial.
Which reminded me I totally forgot to post that tutorial on my blog so here it is:
Read the rest of this entry »