uzik
22-03-2007 00:02:01
Can anyone suggest a good method of tracking down what looks like a buffer overrun/loose pointer bug?
I'm trying to use PLSM2.
In the frameEnded event I call pScenemanager->getPageManager()
to get the page manager:
It blows up because PagingLandScapePageManager::mCurrentcam
is 0xfeeefeee. I understand this is the value STL writes to invalid
locations. I assumed someplace the camera was part of a vector or
stl list and it's being invalidated, or perhaps just a pointer to a local
variable was passed and it went out of scope.
In the page manager mCurrentCam is set when ogre calls it. I set a break
point to make sure it's only called once. The code saves a good pointer
to the camera and it's not changed anywhere else in this class.
Any suggestions how to find this bug?
I'm trying to use PLSM2.
In the frameEnded event I call pScenemanager->getPageManager()
to get the page manager:
PagingLandScapePageManager* pm = mSceneMgr->getPageManager();
unsigned int CurrentCameraPageX = pm->getCurrentCameraPageX();
unsigned int CurrentCameraPageZ = pm->getCurrentCameraPageZ();
It blows up because PagingLandScapePageManager::mCurrentcam
is 0xfeeefeee. I understand this is the value STL writes to invalid
locations. I assumed someplace the camera was part of a vector or
stl list and it's being invalidated, or perhaps just a pointer to a local
variable was passed and it went out of scope.
In the page manager mCurrentCam is set when ogre calls it. I set a break
point to make sure it's only called once. The code saves a good pointer
to the camera and it's not changed anywhere else in this class.
void PagingLandScapePageManager::updatePaging(PagingLandScapeCamera *cam)
{
mCurrentcam = cam;
Any suggestions how to find this bug?