Skip to content

Instantly share code, notes, and snippets.

@breezhang
Created February 4, 2014 12:08
Show Gist options
  • Save breezhang/8802505 to your computer and use it in GitHub Desktop.
Save breezhang/8802505 to your computer and use it in GitHub Desktop.
.net Event memory leak

p

If the source object has a longer lifetime than the listener, and the listener doesn't need the events anymore when there are no other references to it, using normal .NET events causes a memory leak: the source object holds listener objects in memory that should be garbage collected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment