Free the frame correctly
Join the thread in the destructor