Sign in to follow this  

DeviceReset event problems

This topic is 3666 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I'm having issues with the DeviceReset event. It fires, against my expectations, when I'm closing the window/application. The problem it self lies in that a Null reference Exception is thrown without any indication as to where it occurs (Even while debugging in VS2005). I'm suspecting that is the a List object that stores some of my render objects that load some resources upon device reset. As far as I know that is quite common. I can verify this, since if I don't subscribe to the event then no exception. Can anyone point me in some direction as to how to overcome this unfortunate feature? :)

Share this post


Link to post
Share on other sites
Ok, I found one solution and I guess it will do.
I'm subscribing to the FormClosing event available on the windows form instance.

What I'm doing in the event is to detach from the DeviceReset event and I'm home safe.

Should also be a bit more thorough and perform a proper cleanup, but is for another time :)

Thanks for the tip.

Share this post


Link to post
Share on other sites

This topic is 3666 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this