Static destructors for subsystem cleanup

Using destructors for static objects is the only way to ensure that a subsystem in a shared library performs some kind of cleanup at application quit time. Any static object destructor in your library can take care of finalization.

Because tasks don't always quit cleanly, you can't depend on shared library code to clean up resources used by the whole system; if the task quits unexpectedly, the resources do not get cleaned up. For those cases, have a server that manages the resources. You can use the connection capabilities of PROSE (part of the Message Streams library) and the Remote Object framework to track clients who die. If the client terminates normally, the normal cleanup can happen; but if the task disappears, the server must clean up all resources used by that task.

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker