In the program I’m working on, I am using crtdbg.h to identify memory leaks in my code. However, whenever I try to call
glfwPollEvents(), I’m getting this error:
Exception thrown at 0xCDCDCDCD in [name].exe: 0xC0000005: Access violation executing location 0xCDCDCDCD
I know this is some sort of uninitialized heap memory error. After some testing, I figured out that this only occurred because of this:
#ifdef _DEBUG #define _CRTDBG_MAP_ALLOC #include <stdlib.h> #include <crtdbg.h> #define dbgnew new(_NORMAL_BLOCK, __FILE__, __LINE__) // <- This #define is making glfwPollEvents error #else #define dbgnew new #endif
I don’t understand how this is making the error… The name of the #define is not the problem. I literally tried renaming it to
aksdfjklasdjglkasdhgalks and it still errored. How the heck does me defining a macro for myself cause
glfwPollEvents() to error?!
Thanks for any help.