Fix crash at exit
Add proper LogCapture destructor