I am currently writing a cmod for some obscure piece of hardware. Its driver tends to generate kernel panics if some deinitialization does not happen. It would therefore be nice if it was somehow possible to force the destruction of certain objects on exit, even without --with-cleanup-on-exit. Is there a possibility for that?
And no, I cannot fix the kernel driver ;-)
On Fri, Apr 1, 2011 at 4:19 AM, Arne Goedeke el@laramies.com wrote:
happen. It would therefore be nice if it was somehow possible to force the destruction of certain objects on exit, even without --with-cleanup-on-exit. Is there a possibility for that?
Have a look at set_exit_callback()/pike_set_prog_event_callback().
Have a look at set_exit_callback()/pike_set_prog_event_callback().
They won't be called either when pike exits unless you've configured with --with-cleanup-on-exit. Arne needs to use add_exit_callback, or do something from the PIKE_MODULE_EXIT function, because iirc they are always called before exit, regardless of configure options.
Lucky indeed. add_constant(random_string(15), thing with set_exit_callback() set) does the trick.
pike-devel@lists.lysator.liu.se