Fixed possible memory leak of dynamic CompareThread object