Vote UpVote

WeakRefence in Delphi - solving circular interface references

VSoft Technologies – Using interfaces and reference counting in Delphi works great for the most part. Its a feature I use a lot, I'm a big fan of using interfaces to tightly control what parts of a class a consumer has access to. But, there is one big achillies heel with reference counting in Delphi, you cannot keep circular references, at least not easily, without causing memory leaks. Consider this trivial example : IChild = interface; IParent = interface ['{62DC70E1-8D82-4012-BF01-452EB0F7F45A}'] procedure AddChild(const AChild : IChild); end; IChild = interface ['{E1DB1DA0-55D6-408E-8143-072CA433412D}'] ...
Favorite? Off-Topic? 2010-03-26 20:00


Visits: 28
Votes: 0
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


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