[PD-dev] inverse of myclass_setup()? myclass_unsetup()?

Claude Heiland-Allen claudiusmaximus at goto10.org
Sun Jan 7 12:46:13 CET 2007


Hi,

Say I have the following:

hsext_setup() {
   /*
     start Haskell run time system
   */
}

hsext_unsetup() {
   /*
     stop Haskell run time system
     cannot be restarted hereafter
   */
}

Am I correct in assuming hsext_setup() will be called at most once?

How can I ensure hsext_unsetup() is called when Pd exits?

Is atexit() the right way?  Seems dirty:

----
$ man atexit

Since glibc 2.2.3, atexit() can be used within a shared library to 
establish functions that are called when the shared library is unloaded.

Functions registered using atexit() are not called if a process 
terminates abnormally because of the delivery of a signal.
----



Thanks for any ideas,


Claude
-- 
http://claudiusmaximus.goto10.org




More information about the Pd-dev mailing list