ALX
Well-known member
Recently I noticed something strange going on in VS due to some sloppy programming on my part. An event being raised from one form was being handled in another form, which is what it typically SHOULD be doing, except that the form doing the handling had been closed and disposed. 'No errors like "trying to access a disposed object" or anything like that. In fact the handler executed perfectly as if the disposed form was still active. This got me thinking, (I know that's dangerous), that there could be many event handlers taking up valuable space in VS's memory that should have been long since trashed. It also got me thinking about the cases where I've used the "AddHandler" statement and not been in a position to remove all of those handlers at the closing of a form. My question is: If I don't specifically "Remove" any handlers that I've added at run time, will those handlers be lingering, or taking up resources after the handling forms have closed?