I need some expert comments regarding graceful process termination in Symbian.
When a process is killed using RProcess::Terminate(), the process just goes down without doing any cleanup. My process has a session (RSyncMLSession), with an external SyncML engine. which is open for process lifetime. The executable is killed by a UI app using RProcess::Terminate(). The open SyncML session should be closed (using RSyncMLSession::Close()) by the process before dying.
Where can I do this? Is there a pre-defined cleanup routine in Symbian executables (.exe) where I can put my cleanup code? Or can a signal handler (like in Unix) be defined to handle this?
The process has an CActive Active Object and the Active Sscheduler is installed. I don't see the Cancel() routine of the Active Object called either, before the process goes down. So too doesn't seem like a good place to do this.
Any other suggestion is also welcome.
Thanks in advance,