For some reason, my app is giving me an error I cannot figure out.

Here is the error...

"The exception unknown software exception (0xc0020001) occurred in the application at location 0x7c57e592."

It happens when I close the program. Not everytime I close it though. I am able to recreated it any time. But when I step through the code, everything does as expected until I hit the close button.

I don't know how to figure out what the problem might be.

Can anybody help.

Thanks