I suppose (according to your log) you call Uninitialize when you have worked threads. So you should either wait until the threads end or don't call Uninitialize at all.