So here's the deal, I've been working on a roguelike game in c++ using the advanced windows console functions in wincon.h. I have a randomly generated map and I'm drawing it to a screen. Every once in a blue moon when I'm running the program it will give me an access violation error on program close. I can run the program probably 50 times and if I'm lucky (unlucky actually) the error will show up.
I'm using codeblocks as my IDE and have the debugger set to break on an exception. I have been unable to actually recreate the access violation while using the debugger. It only seems to occur when I do a basic run of the program. It doesn't crash the program or lock up, it just gives the error code on close.
There is too much code to post here but you can look at it on github: https://github.com/Rubiks14/ASCII . I believe the error is happening in map.h but it might not hurt to look into screen.h and screen.cpp as well. Also I'm sorry for the craziness of the code in advance. Some of the comments are relevent but others need to be updated. I know there are a few things that need to be broken down into more functions and some stuff that would work better if passed by reference (the vectors), I'm just trying to eliminate this bug before altering anything else and before adding any new features.
One more thing. I think the problem is somewhere in the drawing procedures for the map or screen class.
EDIT: Fixed broken link