frontend.cpp: use m_state != stateClosed instead of use m_sn to check if the frontend...