Modified main process cannot exit bug , and add auto ptr .