Extension manager leaving point

I allocated some shared memory segment in MainEntryPoint() of my extension manager. The callback fuctions use this shared memory to store domino data. I need to detach the shared memory when the Domino processes go away. The thing puzzle me is, does the extension manager has a function like MainLeavingPoint on UNIX/LINUX, so I can detach the shared memory? Or Is there a OS level function can detect that the extension manager is quiting?

Thanks in advance.