Hello,
I''m having trouble with deconstructing my SceneGraph class. Exception would be thrown, why I don''t know... Help me out here ya''ll.
my class hierarchy:
I have 3 classes KSceneGraph, KTransformNode, and KGeoNode derived from KObject class. KSceneGraph contains a list of KTransformNodes and KtransformNodes contain a leaf node which is a KGeoNode object.
Here is a simple console program to illustrate my problem:
KSceneGraph root;
int main()
{
char text_1[50];
char text_2[50];
char text_3[50];
KTransformNode* node;
node = new KTransformNode();
node->init();
root.attachTransformNode(node);
delete node; //throws exception here...
return 0;
}
And the part that is the problem...this is where the debugers get stuck at...
KTransformNode::~KTransformNode()
{
while(head->next !=NULL)
{
current = head->next;
head->next = current->next;
delete current;
}
delete GeoNode;
delete head;
}
All help appreciated.
"Stop thrownin crap at my dome..."-My drunk room mate 4/20 2000