Original Post
Hi guys i have just posted another thread a min ago but i didnt want to put to many subjects in one thread so i started this one 
i am getting an error when my program shuts down
i think this is happening when i add objects or frames to a parent frame( or to a child or any frame lol)
i had this error when loading only one frame with one mesh and when i commented out the addobject() i didnt get the error anymore.
can you see any obvious causes for this error?
many thanks in advance
i am getting an error when my program shuts down
HEAP[classfull.exe]: Invalid address specified to RtlValidateHeap( 006D0000, 00593710 )
Windows has triggered a breakpoint in classfull.exe.
This may be due to a corruption of the heap, which indicates a bug in classfull.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while classfull.exe has focus.
The output window may have more diagnostic information.
i think this is happening when i add objects or frames to a parent frame( or to a child or any frame lol)
i had this error when loading only one frame with one mesh and when i commented out the addobject() i didnt get the error anymore.
class CZenFrame;
typedef int (*FRAME_MOVEMENT_CALLBACK)( CZenFrame* pFrame, void* Parameter);
class CZenFrame
{
public:
CZenFrame();
~CZenFrame();
void* m_pParameter;
// Variables
protected:
D3DXMATRIX m_Local;
D3DXVECTOR3 m_vPosition;
D3DXVECTOR3 m_vVelocity;
float m_Yaw, m_Pitch, m_Roll;
CZenObject* m_pObjectList;
CZenFrame* m_pNext;
CZenFrame* m_pChildFrameList;
CZenFrame* m_pParentFrame;
FRAME_MOVEMENT_CALLBACK m_pfnCallback;
BOOL m_bCallback;
public:
HRESULT SetCallback( FRAME_MOVEMENT_CALLBACK pfnCallback);
void SetVelocity( float x, float y, float z);
void GetVelocity( float& x, float& y, float& z);
void SetPosition( float x, float y, float z);
void GetPosition( float& x, float& y, float& z);
void GetLocal( D3DXMATRIX& pMatrix);
void SetYaw( float Yaw){ m_Yaw = Yaw;}
void GetYaw( float& Yaw){ Yaw= m_Yaw;}
void SetPitch( float Pitch){ m_Pitch = Pitch;}
void GetPitch( float& Pitch){ Pitch = m_Pitch;}
void SetRoll( float Roll){ m_Roll = Roll;}
void GetRoll( float& Roll){ Roll = m_Roll;}
void Update();
HRESULT AddObject( CZenObject* pNewObject);
HRESULT Render();
void SetNext( CZenFrame* pNext){ m_pNext = pNext;}
CZenFrame* GetNext(){ return m_pNext;}
HRESULT AddFrame( CZenFrame* pNewFrame);
protected:
void SetParent( CZenFrame* pParent){ m_pParentFrame = pParent;}
CZenFrame* GetParent(){ return m_pParentFrame;}
};
HRESULT CZenFrame::AddFrame( CZenFrame* pNewFrame)
{
if( !pNewFrame)
{
SetError( "Failed to add child frame");
return E_FAIL;
}
pNewFrame->SetParent( this);
if( !m_pChildFrameList)
{
m_pChildFrameList = pNewFrame;
}
else
{
CZenFrame* pTempFrame = m_pChildFrameList;
while( pTempFrame->GetNext())
pTempFrame = pTempFrame->GetNext();
pTempFrame->SetNext( pNewFrame);
}
return S_OK;
}
HRESULT CZenFrame::AddObject( CZenObject* pNewObject)
{
if( !pNewObject)
return E_FAIL;
pNewObject->SetParentFrame( this);
if( !m_pObjectList)
{
m_pObjectList = pNewObject;
}
else
{
CZenObject* pObject = m_pObjectList;
while( pObject->GetNext())
pObject = (CZenObject*)pObject->GetNext();
pObject->SetNext( pNewObject);
}
return S_OK;
}
CZenFrame::~CZenFrame()
{
CZenObject* pObject = m_pObjectList;
CZenObject* pTemp = 0;
while( pObject)
{
pTemp = (CZenObject*)pObject->GetNext();
free( pObject);
pObject = pTemp;
}
}
can you see any obvious causes for this error?
many thanks in advance