5
votes
Vote UpVote

An Interface You Can Count On

TPersistent.com – Using refcounted interfaces can be difficult, especially when introducing them into legacy code.  Unfortunately, interfacing is key to breaking dependencies and making code more testable. There are only two approaches I have seen to debugging refcount issues: 1) Create a descendant of TInterfacedObject and override the _AddRef/_Release to log class information and the current refcount.  You could also use copy/paste inheritance (although I do not recommend making a habit of it), and change the implementations. 2) Create your own Interface like I did that exposes the RefCount and ClassName ...
Favorite? Off-Topic? Larry Hengen @ 2014-01-15 18:37

Statistics

Visits: 1298
Votes: 5
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Jeroen Pluimers
Neonimous
Paul Thornton
rgreat
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)