I am trying to release resources allocated in daemon process at the end of it or if someone quits the process.
Lets say,
int main(int argc, const char * argv[])
{
Controller *controller = [[Controller alloc] init];
[controller allocateresources];
[[NSRunLoop currentRunLoop] run];
[controller release];
return 0;
}
Here Controller release will not be called. Quit [SIGTERM Signal] just terminates the runloop. How can I release resources allocated in class Controller at the end of application?
EDIT: I understand that system will claim resources back. The thing, I am trying to solve is something like cross process cooperative locks.