Line 23 in your code Node<T>* tmp2 = tmp;
tmp2 points to the same Node that tmp does. Calling delete tmp2;
therefore has the same effect as calling delete tmp;.
Did you intend to change what tmp points to with line 24 tmp = tmp->getRight(); ?
This only changes the local copy (within the function) and does not affect the pointer which was passed to the function. You must pass the pointer by reference if you wish to change what it points to. Node<T>*& tmp
you go 1 step to the right, afterwards some steps to the left...maybe tmp2 is the very last one which is != 0 so youre endeng up on the exact position where you came from...(maybe)