When creating C modules that are wrappers around 3rd party libraries, you often have to allocate some struct when the object is created, and free it when the object is destroyed.
What is the right way to do this? Assuming we have: CVAR struct foo_struct *foo;
Do I set foo = NULL in INIT, then foo_init(foo) in create? Or should I just be doing the foo_init(foo) in INIT? And when freeing it later, should I be doing foo_destruct(foo) in EXIT or in destroy?
Also, when using CMODs INHERIT, do INIT and EXIT get inherited as well, or just PIKEFUNs PIKEVARs and CVARs?
Thanks Adam