Im working on a data structures assignmnet and something very strange is happening , my structure contains of 4 avl trees , in the destructor of the structre I delete the 4 trees using delete (the trees are allocated with new in the constructor) , a method of the class is called Quit and all it does is "delete this" calling the destructor , when calling Quit and before it operates any command (before doing the "delete this" ) two of the avl trees are already null and one is with adress 0x1 and one is with legal adress but the right and left sons of the root are 0xabababababababab and 0xfeeefeeefeeefeee so when calling the destructor and trying to delete them a SEGMENTAION FAULT or SEGTRAP accures , because 0xabababababababab is not NULL and there for the fucnction does not enter the if(!node){return;} and calls the recursively for the right son , and that where the seg fault happens , because accessing fields of 0xababababababab is like accessing fields of NULL a pic of the structures trees before entering "Quit"
what I dont understand is when does this happen to the trees ? because when debugging , in the end of the last function before Quit the fields and trees are all 100% as expected to be so nothing of them is deleted of changed in any way in the code. I spent days trying to find the problem , PLEASE HELP. THANK YOU IN ADVANCE.