I have a timer class..This timer will be started from various portions of my code blocks..I have another class to manage this timer namely CTimerManager…This is a static class ..So the issue i face here is when i de-initialize my application all my timer needs gets destroyed…But since i have started many timers when the first timer goes off the memory goes NULL and if any other timers are active and it tries to access the memory exception occurs(due to the singletn instance of CTimerManager)… Anyone have an idea of how to face this issue
Share
Only create timer instances via a factory method of you
CTimerManagerclass. These timers are intrinsically bound to your manager, and belong to it, and therefore only the manager should take responsibility for their creation and deletion.In your manager class’ destructor you should halt all your timers and delete them. That way no timer will remain alive or active once the manager has been destroyed.