atexit functions not called?
#1
I am trying to register an atexist function:
Code:
def cleanup():
  whatever

import atexit
atexit.register(cleanup)

and at various points in the script depending on how it is called, I call sys.exit()
...which should trigger a call to cleanup according to the python docs...

Is there something non-standard about the way xbmc python exits??
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#2
yes and no. we use it as a library. atexit hooks will only work for script ran through the python interpreter binary. technically our python doesn't exit before no scripts are running, and these days, that's really .. never. until xbmc app stop.
Reply
#3
Ok thanks, makes sense, will do a manual exit function instead.
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply

Logout Mark Read Team Forum Stats Members Help
atexit functions not called?0