Access Violation
Posted: Wed Sep 30, 2009 11:50 am
Ok, im trying to create a chat system that runs concurrently with the irrlicht engine. So i can have a game and chat system at the same time.
To do both, ive got a nested loop (probably a bad thing).
The definition of Run() is this:
The issue is, when i close the program, i get an access violation at this line
Im guessing its because its trying to run the device, yet its been dropped.
Any suggestions on what i can do to stop it from crashing[/code]
To do both, ive got a nested loop (probably a bad thing).
Code: Select all
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
//Run the game, simple draw/update loop.
game->Run();
}
Code: Select all
void Game::Run()
{
while(device->run())
{
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
device->drop();
}
Code: Select all
while(device->run())
Any suggestions on what i can do to stop it from crashing[/code]