DotNetKick.com is an open-source project. Please report any bugs and let us know your great suggestions. Currently running svn revision 620 (rss)

Kick Spy!, Kick Zeitgeist and Kick Widgets

26
kicks
published 5 months, 5 days ago, submitted by shaharab 5 months, 5 days ago

dev102.com — Although the .NET Framework takes the memory management task out of your hands, there are still a few things that you must pay attention to when disposing of an object in order for the Garbage Collector to do its work properly.

tags: , , | tag it

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:

Comments:
This is a known problem with this pattern and GC based systems under the name <a href="http://damieng.com/blog/2005/01/19/lapsedlistenersmemoryleaksinsubscriberpublisherscenarios">lapsed listeners</a>.

You can't always remove from the event mechanism if the objects are managed elsewhere and it doesn't provide a facility to do so - e.g. TreeView control.

Thankfully .NET 3.5 has a <a href="http://msdn2.microsoft.com/en-us/library/system.windows.weakeventmanager.aspx">WeakEventManager </a> class that can provide event services without this problem by keeping weak references to the listeners.

[)amien
posted by DamienG DamienG 5 months, 5 days ago
Arg, doesn't DNK handle <a> tags yet!!

This is a known problem with this pattern and GC based systems under the name http://damieng.com/blog/2005/01/19/lapsedlistenersmemoryleaksinsubscriberpublisherscenarios lapsed listeners.

You can't always remove from the event mechanism if the objects are managed elsewhere and it doesn't provide a facility to do so - e.g. TreeView control.

Thankfully .NET 3.5 has a http://msdn2.microsoft.com/en-us/library/system.windows.weakeventmanager.aspx WeakEventManager class that can provide event services without this problem by keeping weak references to the listeners.

[)amien
posted by DamienG DamienG 5 months, 5 days ago



information Login or create an account to comment on this story
 

Sponsored Link: www.carlist.ie

Search:

Ads via The Lounge