in reply to Understanding garbage collection specifics...
A daemon generally has to fork or something similar to handle new requests and this tends to ensure termination rather than collection.
Otherwise declare request structures at a higher scope than the request servicing routines and simply remove them on completion - any working references at a lower level will not then prevent garbage collection.
Update: alternatively, even easier: declare within the scope of the service routine and return blanco or only a status code to the higher scope on completion - no references will out-survive the handling in that case.
-M
Free your mind
|
|---|