free all the trees in test code