You have to make sure that you have properly terminated any threads and or objects you may have started.