How to automatically close and destroy a CActive object ?
Login to reply to this topic.
Tue, 2005-02-15 12:56
Joined: 2005-02-13
Forum posts: 4
When ive done all things in RunL() how to escape from RunL and how to automatically destroy the CActive ? Im searching sth. like FreeOnTerminate (in Delphi). I mean if I escape the execute procedure in a delphi thread and if I set FreeOnTerminate on true the delphi thread will be automatically destroyed and freed. How to do this with a Symbian CActive object ?

Tue, 2005-02-15 14:16
Joined: 2004-11-03
Forum posts: 26
Hi ledil, I'll try to answer your question for you, but others may be able to poke holes in what I'm saying (please feel free guys!)...

An active object is "just" an object really, that usually has a handle to a kernel or server-side resource. Once the handle has been closed (usually by Cancel()?) and the request has been completed then it won't be taking up any CPU time, and hopefully not too much memory!

If you do need to destroy the active object, then you can just do so as you would any other object - with the "delete" operator.. You could do this in a callback function that the active object would call upon it's completion. Or else where - just ensure that the object's request is cancelled before deletion, or the AS will give a stray signal error.

Hope that helps,

Scarfman007

copyright 2003-2009 NewLC SARL