Java and c# don't have the need for memory clean up, everything is basically treated as a pointer (or in java terms, a "reference"), but you never have to return an address value. It is pretty self managing.
Anyways, I am trying to debug my c++ app, so I am still in the learning process. I had never had any problem until this past week. I removed everything I changed but my app still seems to crash. Most of my classes are static.
However, it crashes at the end of the main function. When I debug, it brings me to an assembly language file, which looks like it is reading the beginning of main.
crashes here (unhandled exception):
Code: Select all
#ifdef _WINDOWS
APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
#else
main()
#endif
{
class GameManager* gamemanager;
bool restart = true;
while(restart)
{
gamemanager = new GameManager();
std::cout<<"A new manager has been created\nRunning game loop now...";
restart = gamemanager->Run();
std::cout<<"exited\n";
std::cout<<"Game manager will be destoyed...";
//gamemanager->~GameManager();
gamemanager = 0;
std::cout<<"done\n";
}
std::cout<<"Goodbye\n";
//IT CRASHES AFTER THIS COMMENT
};Code: Select all
main_loop:
mov eax,dword ptr [ecx] ; read 4 bytes <--crashes here
mov edx,7efefeffh
add edx,eax