global.cpp CGlobal::~CGlobal() { // thread_->ExitInstance(); if(thread_){ WaitForSingleObject(thread_, INFINITE); delete(thread_); } }