Link to home
Create AccountLog in
Avatar of purplesoup
purplesoupFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Do you need to “unwire” event handlers in ASP.NET webforms

I was just learning about the ANTS memory profiler and was surprised at the example given in the walkthough:

http://www.red-gate.com/products/dotnet-development/ants-memory-profiler/walkthrough

The memory leak in the example was caused by registering for an event but not unregistering.

In ASP.NET I'm sure I never write any unregister code - so I had a google to see if I should. I found this page:

http://stackoverflow.com/questions/6416218/do-you-need-to-unwire-event-handlers-in-asp-net-webforms

which seems to conclude you don't, but one comment suggested there could be a problem. Does anyone know conclusively the answer to this one?
ASKER CERTIFIED SOLUTION
Avatar of Paul Jackson
Paul Jackson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of purplesoup

ASKER

Thanks for your help.