Original Post
i have written 2 classes, both of them has a pointer to other like a parent-child situation. on parent destruction all childs are destroyed one-by-one. the problem is on destruction of child it has something to do on its parent (also child has a pointer to its parent) but when calling its parent's any member the program fails with "abnormal termination" or something like that. i realized that the this occurs when the parent is destroyed because it tries to kill all childs and the child tries to modify its parent's some data and BOOM... the program terminates i know the problem but can you suggest me a solution? i know i didnot write the classes because they are so long (really) but imagine 2 classes like that i tried to first empty(delete) all childs then self-destruct but the classes' logic prevented this to be performed In my examples a child can die anytime but the parent only dies at program termination (maybe i couldnot explain it but offer me another solution) struct Child; struct Parent{ //all public , no matter Child* List[MAX]; int Childcount; ~Parent ( ){ for( int i =0 ; i ) delete List; } } }; struct Child{ //all public , no matter Parent * Mummy; ~Child ( ){ Mummy->ChildCount--; } }; NOTE: i wrote those classes to explain my problem , they may contain errors and i just wrote them in a few seconds