My custom timer is cancelled when loading a *.blend file I have implemented a ModalTimerOperator, based on the sample in Blender's Python templates. At the moment it can be started, stopped and restarted by buttons (located in a menu added to the Info header for testing purposes). Later it should be started automatically when activating the addon I am working on. Important: The timer is intended to run until Blender is closed.

But now I observed that the timer's cancel() function is called as soon as a *.blend file is loaded, and it stops working therefore (I fear there may be other events doing the same). Putting a return statement into the cancel() function before calling wm.event_timer_remove() does not help.

So my questions are:


How can I prevent my timer from being cancelled?
Is it possible to restart the timer automatically if cancelled? (My try to restart it from a kind of Python watchdog thread causes Blender to crash as the API documentation's "Gotchas" chapter predicts.)
First such practice as modal operator running in background without user actually starting it from UI or having the ability to end it is bad. For example it will block F8- reload plugins.

Try to use the scene_update callback list in app.handlers instead of modal operator for what you wanna do.

Now also from such callback list you can monitor if some modal operator is or is not running and eventually call it. But again, this is very dirty.