Tech Off Thread

2 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

.net Framework Bug

Back to Forum: Tech Off
  • User profile image
    CodeGuru

    The .net Framework Raised an Exception when Raising an Event whos one of its subscribers is a disposed object if the event handler try to access or change an instance field or property, and works fine if that event handler does not access any instance data then the Event Firing works fine. ((you should vote here if you want this bug solved)) [http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=a0d5e096-2621-4059-b06b-c41a64e4286a]

  • User profile image
    nightski

    Should this really be considered a bug?  I don't think so.  Really in my opinion it is up to the developer to properly unsubscribe from events when the object is being disposed.

    Its a simple fix.  Just implement the disposed pattern.

    The problem with your solution - to handle it automatically - is how far should this be extended?  Should the developer have to close files when he/she is down with them?  How about closing database connections?  Etc...


    This is just proper resource management.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.