move delete m_captureData form a if branch to the end of function