Fix for buttons vs2010 project
merged
Shutting down the encoding thread on exit ...