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?
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?
Do you have any clever interface debugging tips or tricks?
There is this: https://github.com/AquaSoftGmbH/RefCountTracer
ReplyDeleteIt helps you find memoryleaks, but also could show you if a refcount goes below 0.
Refactor them away :-)
ReplyDeleteWhen 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.
Lars Dybdahl Totally agree and it is even worse when reference counting is disabled (like adding an interface reference to an UI component).
ReplyDeleteThis link was very useful. It also points to a good FastMM tutorial. http://stackoverflow.com/questions/3139344/how-to-find-a-dangling-interface-that-causes-an-av-in-delphi
ReplyDeletePaul Thornton and Steffen Binas thanks (:
ReplyDelete