Has anyone ever noticed that while the unregister method is called when disabling a module, it is not called on shutdown?
Under some circumstances, this behavior is less problematic because the (or a) destructor would be triggered anyway, but this does not apply in general, e.g. when there is still a thread running in the background.
Regarding multi threading, there is some information here, but the issue I am facing is different:
As there is a thread running in the background, python first waits for the thread to exit. I have no handler to indicate that blender wants to quit and hence it will wait forever.
I have seen a bug report on a similar topic with ambiguous answers. Has anyone had similar problems and maybe found a solution? Always having to disable the module before being able to quit is not really acceptable
It’s not very nice and somewhat unexpected, and apparantly no way to add a callback like an app handler quit_pre (although I could swear a saw a commit like that added it, or it was just late and i’m already dreaming…)
This is exactly the bug report I was referring to, but we are not talking about the same issue. The bug report is about running a script and I am talking about a addon module. The answer given there (“When an addon is unloaded it’s unregister function will be called”) is wrong in the sense that closing blender does not unload modules, what my example clearly proves.
As this behavior can hardly be intentional, it must be a bug.
@CoDEmanX: If you agree, could you submit this bug? Otherwise I’d have to create an account just for this one issue…