I have noticed that when I was running Windows XP, if my code dereferenced null I would get a crash in debug and I could then easily identify where the bug was coming from. It seems that in Windows 7 (I'm running 64-bit), instead of crashing or creating any sort of notification, the code will simply break its current iteration and start a new one. This has been very frustrating for me, as when this happens it takes much longer to debug than it used to. Has anyone开发者_如何学Python else with Windows 7 noticed this?
The access violation exception is probably being caught by something higher up in the program. If you're using MSVC, under your "debug" menu, look at "Exceptions..." and make sure that "Access violation" is checked (to tell the debugger to give you a first-chance break when the exception is thrown, before it gets percolated up to the usual exception handlers).
精彩评论